From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,2afd440a210c7fb0 X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,df8a3dc583bf1f5f X-Google-Attributes: gid1164f8,public From: tsmurphy@cs.uiuc.edu (TERENCE MURPHY) Subject: Re: Compaq prefers Alpha over Merced! BUT OF COURSE, ALPHA * Date: 1998/08/28 Message-ID: <6s6i11$jla$1@vixen.cso.uiuc.edu>#1/1 X-Deja-AN: 385657324 References: <0095000017115526000002L062*@MHS> <6rukse$3q0$1@usenet01.srv.cis.pitt.edu> <6s17hi$2g8@post.gsfc.nasa.gov> <6s4o0o$q31@news1.panix.com> Organization: University of Illinois at Urbana-Champaign Newsgroups: comp.os.vms,comp.sys.dec In article <6s4o0o$q31@news1.panix.com>, Thor Lancelot Simon wrote: >It's not a "design". It's a common convention among C programmers. > >If you want to use Pascal-format strings instead, you're perfectly free >to -- without any of the intereference that a language that *didn't* >understand that everything was, after all, just memory accessed >with a different granularity, would give you. How do you propose I do this? Say I write a program: main() { char *hello = "Hello"; pascal_format_puts(hello); } How do I get the compiler to generate the hello string as a pascal string? Do compilers typically have a command line option to specify what kind of strings you can use? In particular, does gcc? It seems that the only semi-portable way to do this would be to compile the program with strings constants as writable, and convert each string a run-time. This is a serious, serious kludge, and I'd hardly say that this is a "perfectly free" task (especially since it is likely that many compilers do not even support writable string constants, so it's non-portable, which defeats the main purpose of C). Regards, Terry Murphy