bug-gnulib
[Top][All Lists]
Advanced

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

Re: __nonnull__ declarations


From: Jim Meyering
Subject: Re: __nonnull__ declarations
Date: Mon, 07 Dec 2009 08:05:01 +0100

Bruno Haible wrote:
> Hi Jim, all,
>> >> I suggest you declare those functions with the "nonnull" attribute.
>>
>> I was referring to the functions in progname.h:
>>
>>   set_program_name
>>   set_program_name_and_installdir
>
> More generally, it could make sense to mark many functions in gnulib, from
> "acl.h" to "xvasprintf.h", with __nonnull__ declaration annotations.
>
> Arguments for doing it:
>   - Allows GCC to produce its warning when passed a literal NULL value.
>   - An added piece of documentation (but only when done completely,
>     throughout gnulib).

Another argument for doing it:

    - Allows tools like the clang static analyzer to avoid warning about
        what it would otherwise call a potential NULL dereference.




reply via email to

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