Path: utzoo!attcan!uunet!husc6!rutgers!mtunx!att!ttrdc!levy From: levy@ttrdc.UUCP (Daniel R. Levy) Newsgroups: comp.lang.c,comp.std.c Subject: Why does C standard consider each compiler flag a separate implementation? Message-ID: <2746@ttrdc.UUCP> Date: 13 Jun 88 00:45:34 GMT Organization: AT&T, Skokie, IL Lines: 33 Xref: utzoo comp.lang.c:10663 comp.std.c:46 A while ago, on comp.lang.c, I brought up a point about the trouble "volatile" might cause in that it would imply license to a compiler to consider all variables not so labeled to be non-volatile. This in conjunction with an optimizer which misses no tricks would break old code which depends on volatile behavior of, say, globals. I further expressed the desire that if "volatile" were kept, that there also be specified a way (e.g. compiler flags) of telling the compiler not to assume everything not so labeled is non-volatile without having to actually go in and edit the code manually. I also asked in con- junction with this if the proposed ANSI C standard had anything to say about flags to the compiler. Someone responded (I can't find the article now) and said that the proposed ANSI C standard considers each variation in the behavior of a compiler as influenced by, say, an external flag to be a separate implementation. Perhaps this language puts my proposal beyond the self-described scope of the proposed standard (does it really?) but my question now, is: WHY does the proposed standard say this? The definition if taken literally is silly. If it be taken literally, this means each UNIX C compilation system out there comes with billions of "implementations" of the compiler (considering all the different things that can be defined on the command line with -D and the various permutations of optimization, etc. flags). I could perhaps understand this attitude if there are C compilation systems out there that have no way of implementing compile-time directives but that also seems silly to me. (Like, the compiler has to be told where the input and output are, right? Why can't it be told more?) De-mystify me, please? -- |------------Dan Levy------------| THE OPINIONS EXPRESSED HEREIN ARE MINE ONLY | AT&T Data Systems Group | Weinberg's Principle: An expert is a | Skokie, Illinois | person who avoids the small errors while |-----Path: att!ttbcad!levy-----| sweeping on to the grand fallacy.