Re: GNOME CVS: gnome-core martin



Martin Baulig wrote:

Maciej Stachowiak <mjs noisehavoc org> writes:

If you really want a build to stay warning-free, you need -Werror to
be the default. Otherwise, the few people who use it will spend too
much of their time cleaning up after the people who don't. If someone
really needs to build and can't fix the warnings, they can take the
extra step of turning them off.

Not that I have any say on what the flags are for gnome-core - but
I've noticed that modules which default to -Werror on generally have
no warnings, whereas every gnome2 module that doesn't, gtk+ included,
has a fair amount of warnings in the build, and build warnings tend to
stick aroud long enough that I think most people who claim to do
special cleanup passes to fix warnings are mistaken in their
recollection.


Well, the problem in gnome-core is that these are not just "warnings",
but real errors - 95% of all "warnings" I get in gnome-core are missing
function prototypes - and in the special case of gnome-core, there's a
95% chance that a missing function prototype means that the function
doesn't exist anymore (in GTK+, libgnome, whereever).

It's just more convenient for to get a compiler error (and I can still do
a "make -k" if I want) than just getting a warning and an undefined symbol
later on - but "later on" means when linking - and for shared libraries
at runtime.

I don't want my code to compile and then crash at runtime due to undefined
symbols in one of my shared libraries - I prefer getting a compiler error
so that I can fix the undefined symbol right away.

besides the fact these cflags are gcc specific.


It's best to enable -Werror only when compiling with gcc - nautilus is
an example of a module that gets this right (or bonobo-activation if
you want a GNOME2 example).


It's a macro in gnome-common/macros2 which checks whether it's GCC - and
for --enable-compile-warnings=error, it also includes some GCC-specific
compiler warnings, but checks whether the compiler actually supports them.

Anyway, I hope -Werror continues to be used more. Many warnings are
real bugs!


Yes, especially in gnome-core.

Since I've been doing some work trying to get gnome2 compiled on solaris, I have to agree that -ansi and -Werror would be good things to enable in maintainer mode when you have gcc. So far most of the errors I've found are either missing casts, or outright gccisms that should never have occurred.

--
Frank




_______________________________________________
gnome-hackers mailing list
gnome-hackers gnome org
http://mail.gnome.org/mailman/listinfo/gnome-hackers




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]