[PATCH] util/attr.h: use HAVE___ATTRIBUTE__, not __GNUC__ comparisons

Douglas Bagnall douglas.bagnall at catalyst.net.nz
Wed Mar 23 02:51:06 UTC 2016


Version 2, with additions.
 
>  #if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
>  #define _NORETURN_ __attribute__ ((noreturn))
>  #else
>  #define _NORETURN_
>  #endif
> 
> which would have done the wrong thing for 4.0. With version 5, GCC
> switched to 1-based minor versions, but as gcc-6 has not been
> released, I still have a minor version of zero.

The first time I had "#if HAVE___ATTRIBUTE__" instead of
"#ifdef HAVE___ATTRIBUTE__". Oops.

This also has patches for a few other places doing the same kind of
thing. There are some interesting variations that might need a close
look.

Andrew has RB+ed the first one.

Douglas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: have_attr.patch
Type: text/x-diff
Size: 9379 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160323/78186116/have_attr.diff>


More information about the samba-technical mailing list