Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!prls!pyramid!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.bugs,net.unix-wizards,net.lang.c Subject: Re: weird C-compiler error message Message-ID: <4137@sun.uucp> Date: Fri, 13-Jun-86 23:22:24 EDT Article-I.D.: sun.4137 Posted: Fri Jun 13 23:22:24 1986 Date-Received: Sun, 15-Jun-86 04:20:33 EDT References: <1297@burl.UUCP> <1926@umcp-cs.UUCP>, <4024@sun.uucp> <6916@ki4pv.UUCP> Organization: Sun Microsystems, Inc. Lines: 66 Xref: linus net.bugs:741 net.unix-wizards:15322 net.lang.c:8619 > ) ... if your users are aware that "compiler error" really means "bring this > ) message, along with the source code, to your local support person", ... > > I must take some exception to this. Your local support person is too busy > to tell 50 people that "compiler error: gork blunge snarf" means "formal not > declared on argument list". I must take some exception to this. You're assuming that "compiler error: " *does* mean "formal not declared on argument list". It doesn't (note that, while the S5 compiler does generate such a message in this case, earlier PCC compilers generate *no* error). What it means is "somebody working on the compiler f***ed up". Your local support person better not be too busy to do the appropriate thing in this instance, which is to take the message, source code, etc., attach it to a bug report, and send it to the vendor. > For shame! If (when the time comes to decide where in the argument list you > found the item to be bound) you can't find it in the argument list, you > should make a good effort to emit a useful error. The problem isn't that it didn't find the item in the argument list, it's that it wasn't in the argument list but it didn't realize it. Since it didn't even think there was an error, it could hardly have made an effort to emit any error message, useful or not. It just put its data structures into an inconsistent state. One version of the compiler (S5, VAX) detected this inconsistency later;, by then, it had no idea what the problem was and couldn't make any effort to say anything more meaningful that "oops!". Other versions of the compiler don't even detect this inconsistency. The fix is to properly check that the item which is allegedly being declared as an argument actually appeared in the argument list; see my recent posting here and in "net.bugs.*" for that fix. > Failing that, publish a list of compiler errors as part of the error > list so we know that "gork blunge snarf" means "one of your formal > declarations was not on arg list". Again, I point out that "gork blunge snarf" doesn't mean "one of your formal declarations wasn't on arg list"! It means "something is fouled up here", and it just so happens that the foulup in this particular case was caused by something being declared, in a scope where declarations are treated as formal argument declarations, and the name hadn't previously appeared in the argument list. If the compiler writer had known that a particular "compiler error" message would be emitted when a particular illegal program were fed to the compiler, they would presumably have fixed the compiler to detect the illegal code and not *get* to the place where the "compiler error" message is emitted! At the back of one of IBM's mainframe PL/I compiler manuals (and probably at the back of all such manuals), there is a long list of error messages. Some of them are "compiler error" messages. They generally don't say "this error really means you put extra crud in a DO statement, but we screwed up the parser so it causes an inconsistent data structure in the compiler which is detected later on." They say "report this to your IBM support person", because it means somebody ran across a *bug* in the compiler which, presumably, the compiler writers didn't know was there. The fact that this particular inconsistency was reported as a "warning" rather than a fatal "compiler error" is probably a botch on the part of one of the compiler maintainers. That isn't, however, germane to this particular discussion. -- Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com (or guy@sun.arpa)