develooper Front page | perl.perl5.porters | Postings from January 2008

[PATCH] don't forbid brace groups with g++ 4.2.2

Thread Next
From:
Robin Barker
Date:
January 30, 2008 10:42
Subject:
[PATCH] don't forbid brace groups with g++ 4.2.2
Message ID:
46A0F33545E63740BC7563DE59CA9C6D093A17@exchsvr2.npl.ad.local
I find I can allow brace groups with g++ 4.2.2 without "insane errors ensue"ing.

In turn, this silences some compiler warnings with g++ which are due to the 

non-brace-group form of some *REFCNT_inc macros.



The comment "g++ allows them but seems to have problems with them" appeared in

August 2006, and could be from g++ 3.* or g++ 4.0, so I have tried to set the

limit of allowable g++ versions at 4.2.



Robin Barker



--- ../perl-current/perl.h	2008-01-28 10:24:19.000000000 +0000

+++ perl.h

@@ -448,8 +448,12 @@

 

 /* gcc (-ansi) -pedantic doesn't allow gcc statement expressions,

  * g++ allows them but seems to have problems with them

- * (insane errors ensue). */

-#if defined(PERL_GCC_PEDANTIC) || (defined(__GNUC__) && defined(__cplusplus))

+ * (insane errors ensue).

+ * g++ does not give insane errors now (RMB 2008-01-30, gcc 4.2.2).

+ */

+#if defined(PERL_GCC_PEDANTIC) || \

+    (defined(__GNUC__) && defined(__cplusplus) && \

+	((__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ < 2))))

 #  ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN

 #    define PERL_GCC_BRACE_GROUPS_FORBIDDEN

 #  endif

 <<perl_h-brace-group.patch>> 



-------------------------------------------------------------------

This e-mail and any attachments may contain confidential and/or

privileged material; it is for the intended addressee(s) only.

If you are not a named addressee, you must not use, retain or

disclose such information.



NPL Management Ltd cannot guarantee that the e-mail or any

attachments are free from viruses.



NPL Management Ltd. Registered in England and Wales. No: 2937881

Registered Office: Serco House, 16 Bartley Wood Business Park,

                   Hook, Hampshire, United Kingdom  RG27 9UY

-------------------------------------------------------------------

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About