This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: handling of warnings


On Wed, 2003-08-13 at 10:57, Gabriel Dos Reis wrote:
> skaller <skaller@ozemail.com.au> writes:
> 
> | g++ 3.2.2 doesn't support -Wno-invalid-offsetof
> | 
> | when I use it I get an error:
> | 
> | g++ -Wno-invalid-offsetof -ansi -pedantic -shared -I.
> | tut/examples/tut115.cpp -o tut/examples/tut115.so
> | cc1plus: unrecognized option `-Wno-invalid-offsetof'
> |  
> | I think this behaviour is inappropriate.
> 
> John,
> 
>   The GCC-3.2.x series is closed.  GCC-3.3.x has the option. 

I am aware of that. My comment refers to the handling
of unrecgnised options in *all* versions.
> 
> | By default, if a warning
> | control option is not recognized it should be ignored, or a warning
> | produced. 
> 
> There ought to be a way to tell users that an option is not
> recognized.   Just ignoring is not appropriate.  

I do not agree.Ignoring it, or issuing a warning,
is not only appropriate but it is easy to *prove*
it is the correct thing to do given that the set
of warnings controls should be able to be
changed easily from version to version of the compiler.

As it stands, the -Wno-invalid-offsetof is a totally
useless option, because it doesn't work on version 3.2.2,
and therefore I can't use it because I can't demand
my clients have the latest compiler.

Since the warning itself is unacceptable I have no choice
but to use the stable -w option to turn all warnings off.

Issuing an error when a warning control option is not
recognised is a BUG in gcc. It should be fixed.
The current behaviour renders the warning switches
next to useless.

This is not the only switch affected. Another example is
-Wno-long-long, which has to be switched on to allow
a long long to be used in ISO C++, in a manner similar
to C9X. Of course it will almost certainly be that
the C++ committee adopts this type into C++. Will the switch
then be dispensed with because it isn't appropriate
for *that* version of the compiler? Will it break
my scripts using -Wno-long-long by giving an error?



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]