From: Dominic Dunlop Date: Sun, 26 Nov 2006 12:01:16 +0000 (+0100) Subject: Re: [PATCH] perlhack: some portability updates X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e5afc1aea69c61fd216c89b539e0b6d44ea5b581;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH] perlhack: some portability updates Message-Id: <253514EB-BA57-4A43-93FA-75D6F3CF27BC@mac.com> p4raw-id: //depot/perl@29398 --- diff --git a/cflags.SH b/cflags.SH index 134dfc6..54f8aa1 100755 --- a/cflags.SH +++ b/cflags.SH @@ -152,7 +152,7 @@ case "$gccversion" in warn="`echo $warn|sed 's/-pedantic/ /'`" ;; esac - # Using certain features (like the gcc brace groups) + # Using certain features (like the gcc statemanet expressions) # require knowing whether -pedantic has been specified. case "$warn$ccflags" in *-pedantic*) warn="$warn -DPERL_GCC_PEDANTIC" ;; diff --git a/perl.h b/perl.h index c68ea82..f5b8037 100644 --- a/perl.h +++ b/perl.h @@ -377,7 +377,7 @@ register struct op *Perl_op asm(stringify(OP_IN_REGISTER)); # endif #endif -/* gcc (-ansi) -pedantic doesn't allow gcc brace groups, +/* 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)) @@ -1506,9 +1506,10 @@ EXTERN_C char *crypt(const char *, const char *); * If we have v?snprintf() and the C99 variadic macros, we can just * use just the v?snprintf(). It is nice to try to trap the buffer * overflow, however, so if we are DEBUGGING, and we cannot use the - * gcc brace groups, then use the function wrappers which try to trap - * the overflow. If we can use the gcc brace groups, we can try that - * even with the version that uses the C99 variadic macros. + * gcc statement expressions, then use the function wrappers which try + * to trap the overflow. If we can use the gcc statement expressions, + * we can try that even with the version that uses the C99 variadic + * macros. */ /* Note that we do not check against snprintf()/vsnprintf() returning diff --git a/pod/perlhack.pod b/pod/perlhack.pod index da824b1..ecf363f 100644 --- a/pod/perlhack.pod +++ b/pod/perlhack.pod @@ -2784,7 +2784,7 @@ Perl_va_copy() if the NEED_VA_COPY is defined. =item * -Using gcc brace groups +Using gcc statement expressions val = ({...;...;...}); /* BAD */