util/attr.h: use HAVE___ATTRIBUTE__, not __GNUC__ comparisons
commit88be24c279e29a363c2aabcb68b5f0a1e039f477
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 22 Mar 2016 22:16:48 +0000 (23 11:16 +1300)
committerUri Simchoni <uri@samba.org>
Thu, 24 Mar 2016 14:13:15 +0000 (24 15:13 +0100)
treebc6947ea3793b3b5a1ac95dcad533223f98959e8
parentc027e3d6087df6182746f4e1e08ef0ef801a5ee7
util/attr.h: use HAVE___ATTRIBUTE__, not __GNUC__ comparisons

The comparisons that look like

    #if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )

fail if __GNUC_MINOR__ is 0.  The intended comparison is something
more like

    #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)

However, given that:

 * these checks are really trying to test the presence of
   __attribute__,

 * there are now credible compilers that are not GCC, which have
   __attribute__ but might not be good at emulating __GNUC__
   numbers, and

 * we really face little risk of running into GCC 2.95

 * we have a HAVE___ATTRIBUTE__ check in ./configure

let's not do the version comparisons.

(Untested on GCC 2.95, GCC 3.0 and GCC 3.1).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
lib/util/attr.h