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

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

 



drepper@xxxxxxxxxx (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

Attachment: pgpFW8S0OSmYU.pgp
Description: PGP signature

-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
http://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux