[PATCH 2/3] sys/cdefs.h: export __attribute_alloc_size__

Mike Frysinger vapier@gentoo.org
Thu Jan 24 05:00:00 GMT 2013


On Wednesday 23 January 2013 18:09:31 Roland McGrath wrote:
> > 	* include/sys/cdefs.h (__attribute_alloc_size): Delete.
> 
> Say, "Macro removed."
> 
> > 	* misc/sys/cdefs.h (__attribute_alloc_size__): Define.
> 
> Say, "New macro."

np.  i was using the style picked up from other GNU projects (mostly 
binutils/gdb).

> > +# define __attribute_alloc_size__(...) \
> > +     __attribute__ ((__alloc_size__ (__VA_ARGS__)))
> 
> The norm here is to indent the continuation line just two spaces.
> A reasonable alternative is two spaces from "define".  Three spaces
> from "define" is not compatible with our style.

i copy & pasted it from another place in the file.  i guess that is broken too 
though.  see __attribute_warn_unused_result__ below it.

> > +# define __attribute_alloc_size__(...) /* Ignore */
> 
> It's preferable to use a tab (or multiple tabs, if there is something
> nearby to line up with) between the lhs and rhs of a macro definition.
> The comment is not really necessary at all here, but if it's there
> it should read "/* Ignore.  */".
> 
> The contrary style examples in the file are errors to be fixed,
> not models to be followed.

right ... i just followed the existing style (for both nits here) rather than 
deviating from it.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20130124/96973e2f/attachment.sig>


More information about the Libc-alpha mailing list