[pacman-dev] [PATCH] Declare all local functions static

Allan McRae allan at archlinux.org
Sun Dec 19 06:08:45 EST 2010


On 19/12/10 20:53, Xavier Chantry wrote:
> On Sun, Dec 19, 2010 at 2:31 AM, Allan McRae<allan at archlinux.org>  wrote:
>>
>> be_local.c:70:13: warning: no previous prototype for '_cache_get_filename'
>> [-Wmissing-prototypes]
>>
>> -Wmissing-prototypes aims to detect global functions that fail to be
>> declared in header files.  Given we probably do not want to declare those in
>> a header file and they are restricted to that one translation unit, I
>> figured they should all be declared static...
>>
>
> Just a side note: once you have gotten pacman fully compliant against
> a gcc option like this one, maybe it could be added to the Makefile so
> that we could spot all these small problems during dev ?
>

Sure.  Although, I'm not sure you want all of them...  This is my 
current configure alias:

alias pacfg='CFLAGS="-march=i686 -mtune=generic -O2 -pipe -Wclobbered 
-Wempty-body -Wfloat-equal -Wignored-qualifiers -Wmissing-declarations 
-Wmissing-parameter-type -Wmissing-prototypes -Wold-style-declaration 
-Woverride-init -Wsign-compare -Wstrict-prototypes -Wtype-limits 
-Wuninitialized" ./configure --prefix=/usr --sysconfdir=/etc 
--localstatedir=/var --enable-doc --enable-git-version --enable-debug'

That covers the options in -Wextra that give no warnings (after this 
patch series) and a few more that I find interesting.

Allan


More information about the pacman-dev mailing list