Le samedi 1 août 2009 18:06:49 Marcel Holtmann, vous avez écrit :
> > cc1: warnings being treated as errors
> > netlink.c: In function ‘g_pn_nl_process’:
> > netlink.c:75: error: cast increases required alignment of target type
> > netlink.c:107: error: cast increases required alignment of target type
> > netlink.c:109: error: cast increases required alignment of target type
> > make: *** [netlink.lo] Error 1
> I think there is no way to fix this. It comes from the Netlink packet
> format and macros, which are confusing gcc. That's why I hate to enfore
we only enforce -Werror for the developers and it is important to have
gcc help us catch mistakes that might be easily overlooked.
If I recall correctly, `-Werror' is enforced when maintainer mode is enabled.
Really, turning off maintainer mode is primilarly useful to binary package
maintainers who *might* not want to trigger autotools updates. Then again,
some might waht to have them anyway... I find the underlying assumption to be
a bit restrictive if not flawed.
I would have to look into these one and how we can fix them properly.
As far as I understand, those warnings come from casting receive buffers into
structure with higher-order alignment requirement - with some of your
competitors' CPU architectures anyway ;) Arguably, those are caused by
kernel/libc headers, not Ofono. I will check on Monday if we can fix them by
promoting the receive buffers to larger integer types, but it might make the
But generally, there remain a problem that some warnings might simply be
bogus, or not under our control. For instance -outside of Ofono- I'm yet to
find a way around dummy variable "clobber warnings" when using POSIX thread
cancellation cleanup handlers. Sure, I could make all variables volatile, but
I refuse to damage optimizations for the sake of bogus warnings...
The real shame is that -Werror-* is dysfunctional in GCC :(