bug-gnulib
[Top][All Lists]
Advanced

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

Re: stdlib tweak


From: Jim Meyering
Subject: Re: stdlib tweak
Date: Tue, 22 Dec 2009 22:04:34 +0100

Eric Blake wrote:
> Jim Meyering <jim <at> meyering.net> writes:
>
>> > +static int (*check) (char const *, int, char const *) = symlinkat;
>> > +
>> > in order to validate that a function is correctly declared when the user
>> > includes just the one header named in the standards.  We can then fix the
>> > fallout by making the *.in.h headers pull in the necessary pre-requisites
> for
>> > functions that declared in the wrong system header.  Any objections?
>>
>> Good idea.
>>
>> You might want to use a name less likely than "check"
>> to impinge on the name space of the test program.
>
> I went with signature_check.  Here's the patch:
>
> From: Eric Blake <address@hidden>
> Date: Tue, 22 Dec 2009 10:57:14 -0700
> Subject: [PATCH] tests: add signature checks
>
> These tests will help catch problems similar to the one recently
> fixed for cygwin declaring getsubopt in the wrong header.
...
> +int (*signature_check) (void (*) (void)) = atexit;
> +
...
> diff --git a/tests/test-btowc.c b/tests/test-btowc.c
...
> +wint_t (*signature_check) (int) = btowc;

I haven't looked carefully at each or tested, but...
please use the "static" attribute on all of those,
as in your example above.




reply via email to

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