[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
__nonnull__ declarations
From: |
Bruno Haible |
Subject: |
__nonnull__ declarations |
Date: |
Sun, 6 Dec 2009 23:04:23 +0100 |
User-agent: |
KMail/1.9.9 |
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).
Arguments against doing it:
- People should expect to be able to pass NULL only when the documentation/
specification says so. We should not encourage the expectation that NULL
is valid everywhere.
- It's a lot of work :-)
Opinions?
Bruno
- [PATCH] progname: don't segfault when argv is NULL, Jim Meyering, 2009/12/04
- Re: [PATCH] progname: don't segfault when argv is NULL, Bruno Haible, 2009/12/04
- Re: [PATCH] progname: don't segfault when argv is NULL, Pádraig Brady, 2009/12/04
- Re: [PATCH] progname: don't segfault when argv is NULL, Eric Blake, 2009/12/04
- Re: [PATCH] progname: don't segfault when argv is NULL, Jim Meyering, 2009/12/05
- Re: [PATCH] progname: don't segfault when argv is NULL, Jim Meyering, 2009/12/06
- __nonnull__ declarations,
Bruno Haible <=
- Re: __nonnull__ declarations, Jim Meyering, 2009/12/07
- Re: __nonnull__ declarations, Bruno Haible, 2009/12/10
- Re: [PATCH] progname: don't segfault when argv is NULL, Bruno Haible, 2009/12/06
- Re: [PATCH] progname: don't segfault when argv is NULL, Jim Meyering, 2009/12/09
- Re: [PATCH] progname: don't segfault when argv is NULL, Bruno Haible, 2009/12/09
- Re: [PATCH] progname: don't segfault when argv is NULL, Bruno Haible, 2009/12/09
- Re: [PATCH] progname: don't segfault when argv is NULL, Jim Meyering, 2009/12/09