machine generated code and chatty compilers

thomas.j.roberts tjr at cbnewsc.ATT.COM
Tue Jan 16 02:19:24 AEST 1990


>From article <1477 at mdbs.UUCP>, by wsmith at mdbs.UUCP (Bill Smith):
> In article <923 at thor.wright.EDU>, econrad at thor.wright.edu (Eric Conrad) writes:
>> From article <1471 at mdbs.UUCP>, by wsmith at mdbs.UUCP (Bill Smith):
>> So turn the warning suppression flag on for automatic-generated code.
> 
> How do you decide which subset of the warning messages to suppress?
> 
> To suppress all warnings may hide useful and pertinent warning but
> different programming groups may all have mutually disjoint definitions
> of "pertinent warnings."
> 
> Lint suffers from this effect too.  You can't tweak it to omit just the set
> of errors that you don't care to see.
> 

Maybe YOU can't, but many of us can (i.e. those of us using UNIX).
On UNIX, if this really becomes an issue, simply pipe the output
of lint into a suitably-crafted grep command which will remove
all unwanted warnings. While this may not be the most optimal
solution, it would surely be good enough for most uses.

A better solution is to design the automatic code generator to
avoid outputting "lousy" code. That is the approach I have always
taken.

Also: look at TURBO C, for MS-DOS. It has an extensive set of
flags to enable/disable each individual class of warning messages.
As MS-DOS is limited to a 127 character command line, TURBO C
has an initialization file used for command options. I have
never used this feature, as I always rework my code (or code
generator) until no warning or error messages are generated.

Tom Roberts
AT&T Bell Laboratories
att!ihnet!tjr



More information about the Comp.lang.c mailing list