[Top][All Lists]
[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
- stdlib tweak, Eric Blake, 2009/12/21
- Re: stdlib tweak, Eric Blake, 2009/12/21
- Re: stdlib tweak, Eric Blake, 2009/12/21
- Re: stdlib tweak, Jim Meyering, 2009/12/22
- Re: stdlib tweak, Eric Blake, 2009/12/22
- Re: stdlib tweak, Jim Meyering, 2009/12/22
- Re: stdlib tweak,
Eric Blake <=
- Re: stdlib tweak, Jim Meyering, 2009/12/23
- Re: stdlib tweak, Bruno Haible, 2009/12/23
- Re: stdlib tweak, Eric Blake, 2009/12/23
- Re: ASSERT and _GL_UNUSED macros, Bruno Haible, 2009/12/23
- Re: ASSERT and _GL_UNUSED macros, Eric Blake, 2009/12/23
- Re: ASSERT macro, Bruno Haible, 2009/12/23
- Re: _GL_UNUSED macro, Bruno Haible, 2009/12/23
- new module 'unused-parameter', Bruno Haible, 2009/12/24
- Re: new module 'unused-parameter', Bruno Haible, 2009/12/25
- Re: new module 'unused-parameter', Jim Meyering, 2009/12/25