Related articles |
---|
C compiler warning messages? johnr@ims.com (1997-04-06) |
Re: C compiler warning messages? trt@duke.cs.duke.edu (1997-04-07) |
Proactive Compiler Error Messages cdg@nullstone.com (Christopher Glaeser) (1997-04-08) |
From: | Christopher Glaeser <cdg@nullstone.com> |
Newsgroups: | comp.compilers |
Date: | 8 Apr 1997 09:36:39 -0400 |
Organization: | Nullstone Corporation |
References: | 97-04-042 97-04-052 |
Keywords: | errors, practice |
Recently, a programmer posted a common thread to a USENET news group
complaining about the code generated by the following:
count = count++;
He explained that his code worked *correctly* under an old compiler, and
does not work correctly using some new compiler; hence the new compiler
is defective.
Of course, someone replies that his code has undefined behavior, to
which begins a back-and-forth of which compiler generates the *best*
code for this and other cases of undefined behavior. Various compilers
take an unfair bashing in these exchanges as compiler ABC is declared
better than compiler XYZ because the results for undefined behavior are
*more predictable.
Perhaps compilers should fight back with proactive error messages to
thin the programming pool. Here are a few proposals.
ERROR: The compiler has detected undefined behavior in your program and
all source files have been deleted.
ERROR: Your programs have exceeded the maximum number of defects
permitted by this company. Notification has been sent to HR, and your
job is hereby terminated.
ERROR: You have written so many programs with undefined behavior since
you graduated that you obviously failed to grasp the concept.
Notification has been sent to your school of accreditation, and your
degree is hereby converted to agriculture.
With the growth in net-aware programming, the implementation details
should be fairly straightforward.
BTW, if you want to discuss these ideas further, I'll be in the fields
tending goats.
Best regards,
Christopher Glaeser cdg@nullstone.com
Nullstone Corporation http://www.nullstone.com
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.