RFC: Avoiding #warning (C/C++ preprocessor extension)

Nicolas Goutte nicolasg at snafu.de
Tue Nov 1 15:51:44 GMT 2005


On Monday 31 October 2005 23:24, Michael Pyne wrote:
> On Monday 31 October 2005 17:15, Nicolas Goutte wrote:
> > > I would
> > > say that no release tarball should contain -Werror.  It may be useful
> > > during development but it would be unnecessarily painful for release.
> >
> > ... so you cannot even have it in development, except if everybody would
> > use the same gcc version.
>
> Well the idea is that all of the warnings would be fixed between all of the
> compilers.  i.e. the union of all warning flags would be fixed.  This may
> be unrealistic but then again I haven't heard of compilers removing
> perfectly good warnings so that really shouldn't be an issue.
>
> The issue is when some poor soul tries to compile a package that worked
> with gcc X but they have gcc X+1 and so it breaks for no reason.

It is not so simple. 

It can fail on X-1 too.

Also compiling with -O2 and friends gives extra warning. So if you use 
-Werror, always compile with -O0 to have nice Valgrind data, you will be 
surprised that somebody else, who compile with -O2, will complain.

(The reason is that -O0, does not try to find death/unreachable code.)

>
> Regards,
>  - Michael Pyne

Have a nice day!





More information about the kde-core-devel mailing list