bug-gnulib
[Top][All Lists]
Advanced

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

Re: stdlib tweak


From: Eric Blake
Subject: Re: stdlib tweak
Date: Tue, 22 Dec 2009 21:48:21 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Jim Meyering <jim <at> meyering.net> writes:

> > +int (*signature_check) (void (*) (void)) = atexit; 
> 
> I haven't looked carefully at each or tested, but...
> please use the "static" attribute on all of those,
> as in your example above.

I thought about that, but with:

+static int (*signature_check) (void (*) (void)) = atexit; 

you then get:

  CC       test-atexit.o
test-atexit.c:23: warning: ‘signature_check’ defined but not used [-Wunused-
variable]

So, to avoid the warning, it would have to be:

+static int (* _UNUSED_PARAMETER_ signature_check) (void (*) (void)) = atexit;

I can do that, but it is a bit more work, so please confirm if you'd like to 
see that.  It also means that the gnulib guarantee that _UNUSED_PARAMETER_ 
expands to __attribute__((__unused__)) is a bit of a misnomer, as in this case, 
signature_check is not a parameter.  Do we want to introduce a new alias, 
_GL_UNUSED, and use that instead of _UNUSED_PARAMETER_?  (Unfortunately, we 
have to keep the _UNUSED_PARAMETER_ name around a bit longer - it has crept 
into use in other projects that assume that it is available merely because they 
are using gnulib).

-- 
Eric Blake






reply via email to

[Prev in Thread] Current Thread [Next in Thread]