From: Andy Dougherty Date: Thu, 29 Jun 2006 13:41:28 +0000 (-0400) Subject: HASATTRIBUTE_UNUSED works for gcc-3.3, but not for g++-3.3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=42bf555054770bacf4bf838127bc8a1a352164a9;p=p5sagit%2Fp5-mst-13.2.git HASATTRIBUTE_UNUSED works for gcc-3.3, but not for g++-3.3 Subject: Re: [PATCH] Re: [perl #39634] gcc 3.3 has problems with __attribute__((unused)) Message-ID: p4raw-id: //depot/perl@28453 --- diff --git a/perl.h b/perl.h index 999c619..4921b73 100644 --- a/perl.h +++ b/perl.h @@ -2567,6 +2567,9 @@ typedef struct clone_params CLONE_PARAMS; * http://www.ohse.de/uwe/articles/gcc-attributes.html, * but contrary to this information warn_unused_result seems * not to be in gcc 3.3.5, at least. --jhi + * Also, when building extensions with an installed perl, this allows + * the user to upgrade gcc and get the right attributes, rather than + * relying on the list generated at Configure time. --AD * Set these up now otherwise we get confused when some of the <*thread.h> * includes below indirectly pull in (which needs to know if we * have HASATTRIBUTE_FORMAT). @@ -2588,7 +2591,8 @@ typedef struct clone_params CLONE_PARAMS; # if __GNUC__ >= 3 /* gcc 3.0 -> */ # define HASATTRIBUTE_PURE # endif -# if __GNUC__ >= 3 /* gcc 3.0 -> */ /* XXX Verify this version */ +# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3 /* 3.4 -> */ + /* This actually works for gcc-3.3, but not for g++-3.3. */ # define HASATTRIBUTE_UNUSED # endif # if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3 /* 3.4 -> */