This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Dealing with warnings on __attribute__((user)) when dehydra is not loaded


[ 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]