Jed Davis wrote:
> On Mon, Feb 26, 2007 at 02:00:09AM -0800, Thomas Lord wrote:
>> Per Bothner wrote:
>>
>>> Gcc, one of the larger and more complex Free Software programs
>>> out there, years ago switched to building with many warnings
>>> check for - and warnings teated as errors. This, we've learned,
>>> is a good idea.
>> GCC == C?
To avoid misunderstandings: I mean the Makefile and procedures
for building (bootstrapping) Gcc itself. Gcc does not by
default treat warnings as errors, but there is an option to
do so, which the gcc Makefiles set when building gcc with gcc.
Yes, except for run-time libraries, gcc is mostly written in C.
(The Ada front-end is written in Ada, and the Java front-end
is now the Eclisple compiler, which is written in Jav.)
>> (Roughly true but more or less to the detriment
>> of both and entirely for bogus outcomes of microeconomic
>> processes dominated by people behaving badly.)
Er, whatever.
> There's actually an interesting point buried in here -- is GCC popularly
> considered to become nonstandard when run with -Wall -Werror, even
> though it rejects programs that (I assume) the C spec says are okay?
Many of these programs are undefined, which means the compiler is
allowed to reject them. (I think - I'm not very up on my standardese.)
Though some rejected programs are well-defined - they're just likely
to be errors, such as:
if (x = y) ...; /* I.e. as opposed to if (x == y) ... */
> My impression is that it's not -- and many of the warnings-made-errors
> are pure style issues, rather than anything defined in terms of an
> exceptional condition that might arise.
They're not supposed to be "pure style issues" - they're things that
are (from experience) likely to be errors. Preferably things that
would not be difficult to re-write, so in that sense it is a style
issue:
if ((x = y) != 0) ...
--
--Per Bothner
per_at_bothner.com http://per.bothner.com/
Received on Tue Feb 27 2007 - 03:01:02 UTC