worley@eddie.mit.edu.uucp (Dale Worley) (07/08/88)
I was very pleased to read Phil Pfeiffer's second message. It is surprisingly common to hear from dweebs who think "it works on my compiler, therefore it is valid C" -- just read comp.lang.c. A few notes: You should get a copy of the ANSI C proposal. It may not be wonderful, but it tries to clean up a lot of things that K+R never really defined formally. For instance, there is a systematic varargs facility. You should also note that in ANSI C, a pointer into an array can be incremented so that it points to "the element after the last element of the array". (This is in deference to 10 billion for's that generate this pointer and then test it.) But you may not use this pointer to read memory. However, a pointer cannot be decremented to point to the element before the first element of the array. Steve Benz points out the difficulty of having the compiler/run time code enforce many of these restrictions. If you're interested in seeing what it takes, look at the manuals for IBM's PL/1 checkout compiler, which exhaustively enforces all the language rules. If you're interested in using parallelism during compiling, there is an article the SIGPLAN 88 Conference on Programming Language Design and Implementation: "Semantic Analysis in a Concurrent Compiler" that has a lot of references into the literature. Although it differs from the previous discussions in that it assumes that the number of processors is less than the number of tokens in the program. Dale [From Dale Worley <think!compass!worley@eddie.mit.edu.uucp>] -- Send compilers articles to ima!compilers or, in a pinch, to Levine@YALE.EDU Plausible paths are { ihnp4 | decvax | cbosgd | harvard | yale | bbn}!ima Please send responses to the originator of the message -- I cannot forward mail accidentally sent back to compilers. Meta-mail to ima!compilers-request