[auton-users] New gcc problems
Paul Komarek
komarek at andrew.cmu.edu
Mon Jul 22 17:09:06 EDT 2002
Hello everyone,
SCS GNU/Linux is (somewhat strangely) using gcc 3.1 with their
RedHat-derived GNU/Linux distrobution. This causes subtle problems. gcc
3.1 supports C99 (a new standard for C) 'features' that are not supported
by C89 or g89 (GNU extensions to C89). Among these C99 features is one
which allows mixed declarations (of variables) and code. For example, the
following is legal in C99 but not C89 or g89:
int main(void) { printf("Hello, world\n"); int foo; return 0; }
Any code like this will cause problems for gcc 2.96 and probably other C
compilers. I feel it would be better if such code did not compile.
Forcing gcc 3.1 to throw an error for this code requires the switch
"-pedantic-errors". I would like to add this flag to our Make.common in
the gmake-magic project. It would only be used when compiling with gcc,
and would not affect g++ or any other compilers.
However, this flag requires that we clean up other problems in our
sources, such as source files that are empty after preprocessing (e.g.
draw/fgraph.c). I cannot clean up the sources myself, and would need
cooperation. That is why I am soliciting lab opinion before starting this
project.
If you oppose the addition of -pedantic-errors to our gcc compile lines,
please let me know. Please provide a better reason than "C sux0rs and C++
r0Xors, so mixed-code-and-declarations should be forced down people's
throats" (translation: "C should be like C++, because C++ is cool").
Anyone who does not object is implicitly volunteering 100% cooperation
when I need help fixing their sources. =-)
If you would like to see the effects of -pedantic-errors now, try
compiling with
gmake user_flags="-pedantic-errors"
-Paul Komarek
More information about the Autonlab-users
mailing list