util/attr.h: use HAVE___ATTRIBUTE__, not __GNUC__ comparisons
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 22 Mar 2016 22:16:48 +0000 (11:16 +1300)
committerKarolin Seeger <kseeger@samba.org>
Tue, 2 Aug 2016 10:46:24 +0000 (12:46 +0200)
commit7ae14463b32710c5025376589fa1e7e8bc205bc6
tree8de67bcb1251725126414907dcf67626f73e75cb
parent385c3416048dffc5f3becf894be6e440a16717d6
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).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11750

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 88be24c279e29a363c2aabcb68b5f0a1e039f477)
lib/util/attr.h