This is the mail archive of the
mailing list for the GCC project.
Re: Apply attribute returns_nonnull in libiberty
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: David Malcolm <dmalcolm at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, mikestump at comcast dot net, jakub at redhat dot com
- Date: Fri, 11 Oct 2013 20:20:16 +0200 (CEST)
- Subject: Re: Apply attribute returns_nonnull in libiberty
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 02 dot 1310111939180 dot 6899 at stedding dot saclay dot inria dot fr> <alpine dot DEB dot 2 dot 02 dot 1310111952490 dot 7051 at stedding dot saclay dot inria dot fr> <1381515169 dot 30976 dot 60 dot camel at surprise>
On Fri, 11 Oct 2013, David Malcolm wrote:
On Fri, 2013-10-11 at 19:53 +0200, Marc Glisse wrote:
With the patch now...
-extern char *concat_copy (char *, const char *, ...) ATTRIBUTE_SENTINEL;
+extern char *concat_copy (char *, const char *, ...) ATTRIBUTE_SENTINEL ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURNS_NONNULL;
An aesthetic idea: should the attributes be ordered to reflect the order
that the related entities appear in the declaration? Return types
appear before parameters in declarations, and thus perhaps the
attributes describing them should also.
I have no opinion about it, I'll do whatever reviewers tell me.
This would make the above look like this (introducing a newline to avoid
I didn't introduce new lines because there were already many overlong
lines in this file, but I can wrap those as well if needed.