addition of -Wall to default flags (redhat-rpm-config-8.0.38-1)

Enrico Scholz enrico.scholz at informatik.tu-chemnitz.de
Sun Aug 7 08:56:50 UTC 2005


drepper at redhat.com (Ulrich Drepper) writes:

>> I'd argue that any upstream package which includes -Werror by default
>> is broken, considering how often gcc warnings change.
>
> And I argue that we apparently must come to a state where -Werror is
> enabled automatically.

I would really like to use it, but existing APIs (SUSv3) do not support
warning free development. E.g. 'dlsym()' returns an object pointer, but
often a function pointer is wanted. I do not know a way to write

| #include <dlfcn.h>
| 
| int main()
| {
|   void (*foo)() = dlsym(0, "foo");
|   void (*bar)() = (void (*)())dlsym(0, "bar");
| 
|   foo();
|   bar();
| }

warning-free:

| $ gcc -ldl -Wall -pedantic -W -Werror -std=c99 dlsym.c
| cc1: warnings being treated as errors
| dlsym.c: In function 'main':
| dlsym.c:5: warning: ISO C forbids initialization between function pointer and 'void *'
| dlsym.c:6: warning: ISO C forbids conversion of object pointer to function pointer type


Or, I maintain a library which provides some deprecated functions and
gives out warnings at link-time when they are used. The same project has
some legacy tools (used by some people) which are triggering exactly
these warnings. Enforcing '-Werror' would make it either impossible to
mark obsolete functions (bad for developers), or to build legacy tools
(bad for some users).



Enrico
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 480 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/devel/attachments/20050807/35f710d2/attachment-0002.bin 


More information about the devel mailing list