Dealing with warnings on __attribute__((user)) when dehydra is not loaded
Diego Novillo
dnovillo@google.com
Fri Oct 16 13:43:00 GMT 2009
[ Posting again to gcc@ ]
On Fri, Oct 16, 2009 at 09:12, Benjamin Smedberg <benjamin@smedbergs.us> wrote:
> On 10/16/09 8:17 AM, Diego Novillo wrote:
>
>> void foo(void) __attribute__((user("bleh")));
>>
>> GCC will complain
>>
>> foo.cc:1: warning: 'user' attribute directive ignored
>>
>> whenever dehydra is not loaded. Since our build system uses -Werror
>> for every build, users are not really able to use this attribute in
>> their dehydra scripts. Has anyone run into this? I have suggested
>> guarding the attribute with a special macro and define that macro
>> every time they use dehydra, but that's awkward.
>
> That's what mozilla does. We have a --with-static-checking configure flag,
> and our annotations (NS_FINAL_CLASS etc) are defined conditionally. We have
> to do that anyway since we compile with MSVC and SunCC and other compilers.
OK.
> You could use -Wno-attributes, which suppresses warnings about *all* unknown
> attributes. Alternately, we could modify GCC so that -Wno-attributes takes
> an optional argument, e.g.
>
> -Wno-attributes=user
> -Wno-attributes=NS_stack
Good idea. I'll see about implementing this.
Thanks. Diego.
More information about the Gcc
mailing list