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: 1014db,6bdc5c27a0dec527 X-Google-Attributes: gid1014db,public X-Google-Thread: 1164f8,df8a3dc583bf1f5f X-Google-Attributes: gid1164f8,public From: Dan.Pop@cern.ch (Dan Pop) Subject: Re: Compaq prefers Alpha over Merced! BUT OF COURSE, ALPHA * Date: 1998/09/08 Message-ID: #1/1 X-Deja-AN: 388880636 References: <0095000017115526000002L062*@MHS> <6ssnp9$6pv$1@Starbase.NeoSoft.COM> <6svdad$ggd@web.nmti.com> <6t18af$p83$1@Starbase.NeoSoft.COM> <6t1i0l$241@web.nmti.com> X-Complaints-To: news@sunnews.cern.ch X-Trace: sunnews.cern.ch 905218726 14322 (None) 137.138.32.79 Organization: CERN European Lab for Particle Physics Newsgroups: comp.os.vms,comp.sys.dec,comp.lang.c In <6t1i0l$241@web.nmti.com> peter@baileynm.com (Peter da Silva) writes: >In article <6t18af$p83$1@Starbase.NeoSoft.COM>, >Jordan Henderson wrote: >>I still don't have the Standard document at hand, but does it clearly >>say that non-hosted systems cannot have command line arguments? > >No, of course not. It says that hosted systems *do*. For embedded >systems it's undefined behaviour, There is no way it can be undefined behaviour. If main() does anything special on a certain freestanding environment, the accompanying documentation MUST say so. >and you're allowed to initiate >posterior expulsion of avian primates[1] if you see main(int ac, char >**av). Nonsense. You can safely define a function main(int foo, char **bar) in a freestanding environment, it's just that it won't do anything special, unless the documentation of the compiler says otherwise. >>Even if command line arguments are not supported in non-hosted environments, >>I have the string constants to fall back on for my claim that nul-terminated >>strings are a "feature" of the language. > >No, nul-terminated string *constants* are. What you do with them after that >is outside the language definition, Not quite. Quoting from the language definition (the original ANSI version): 4.1.1 Definitions of terms A string is a contiguous sequence of characters terminated by and including the first null character. It is represented by a pointer to its initial (lowest addressed) character and its length is the number of characters preceding the null character. >and since sizeof("...") does the right >thing you can have any character, including a nul, in one. In a string literal, yes. In a string, by definition, you can't have embedded null characters. >(in fact I recall writing code that involve doubly-nul-terminated string >constants[2], and in embedded environments I've had occasion to use $ as the >terminator[3]) CP/M-80 and, later, MS-DOS, used the $ as the string terminator for some OS system calls. Dan -- Dan Pop CERN, IT Division Email: Dan.Pop@cern.ch Mail: CERN - EP, Bat. 31 1-014, CH-1211 Geneve 23, Switzerland