develooper Front page | perl.perl5.porters | Postings from October 2003

Re: assert.h breaks perl.h

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
October 16, 2003 13:23
Subject:
Re: assert.h breaks perl.h
Message ID:
20031016202223.GT89417@plum.flirble.org
On Thu, Oct 16, 2003 at 10:24:35PM +0400, Alexey Tourbin wrote:

> And here goes the fix for sv.h.
> I believe it was an error.
> 
> ({1}) is not a valid gcc construct.
> ({1;}) is.
> 
> --- /usr/lib/perl5/i386-linux/CORE/sv.h~	2003-09-28 18:58:43 +0400
> +++ /usr/lib/perl5/i386-linux/CORE/sv.h	2003-10-16 22:13:22 +0400
> @@ -551,7 +551,7 @@ Set the length of the string which is in
>  						  SVp_IOK|SVp_NOK|SVf_IVisUV))
>  
>  #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
> -#define assert_not_ROK(sv)	({assert(!SvROK(sv) || !SvRV(sv))}),
> +#define assert_not_ROK(sv)	({assert(!SvROK(sv) || !SvRV(sv));}),
>  #else
>  #define assert_not_ROK(sv)	
>  #endif

I think that I wrote this code originally, and if so I tested it on gcc,
probably either 2.95 or 3.2 (Or at least I thought that I did)
Do you know why I didn't encounter an error? Has gcc changed, or did I
screw up in some way?

Nicholas Clark

Thread Previous | 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