proposal: add -Werror-implicit-function-declaration to the default optflags

Ralf Corsepius rc040203 at freenet.de
Thu Mar 27 13:12:22 UTC 2008


On Thu, 2008-03-27 at 08:38 +0100, Hans de Goede wrote:
> Lubomir Kundrak wrote:
> > On Mon, 2008-03-24 at 22:03 +0100, Hans de Goede wrote:
> >> Hi all,
> >>
> >> This is a new thread spawning from the "3.6% of heads up: Please correct your 
> >> #includes or optflags use" thread.
> >>
> >> I would like to propose to add "-Werror-implicit-function-declaration" to the 
> >> default optflags.
-1

>  Why? Because missing prototypes can cause all sorts of problems:
... why:

-Werror* kills configure scripts for the sake of being harsh against one
single single issue amongst many other issues.

> I disagree, yes it will probably break a large part of the distribution, but 
> fixing it does not have to be a huge effort. My plan is:
> %define optflags "current_optflags -Werror-implicit-function-declaration"
> %define lame_optflags "current_optflags"
> 
> And the if it turns out an application / lib is rather broken with regards to 
> this and fixing it is non trivial, one can simply do:
> export CFLAGS="%lame_optflags"
> export CXXFLAGS="%lame_optflags"
> 
> Before %configure, and if one is using optflags manually in an other way, 
> simply replace the use of %optflags there with %lame_optflags.
That's one how maintainers could check there code ...

Another, simpler and less intrusive way would be maintainer to check
their build-logs (-Wimplicit-function-declaration is part of -Wall)

> > So, why not create a wiki page, plan how to make this harm the least it
> > can (limit the number of packages affected by calling for changes before
> > the rule is enforced), and get it through packaging commitee (or
> > fesco?).
> 
> I could do that, but currently there has been only a little feedback in this 
> thread, so lets discuss this some more first.
c.f. above.

Also, the real issues with current gcc aren't necessarily those related
to implicit functions. "aliasing" is the real thread to bad code. It
kills your "formerly functional" code silently.

Ralf





More information about the fedora-devel-list mailing list