This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Dealing with warnings on __attribute__((user)) when dehydra is not loaded
- From: Diego Novillo <dnovillo at google dot com>
- To: Benjamin Smedberg <benjamin at smedbergs dot us>
- Cc: dev-static-analysis at lists dot mozilla dot org, gcc at gcc dot gnu dot org
- Date: Fri, 16 Oct 2009 09:38:01 -0400
- Subject: Re: Dealing with warnings on __attribute__((user)) when dehydra is not loaded
- References: <mailman.5507.1255695454.4294.dev-static-analysis@lists.mozilla.org> <ivqdnQphNo3a7EXXnZ2dnUVZ_hSdnZ2d@mozilla.org>
[ 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.