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

Re: assert.h breaks perl.h

Thread Previous | Thread Next
From:
Alexey Tourbin
Date:
October 16, 2003 11:24
Subject:
Re: assert.h breaks perl.h
Message ID:
20031016182434.GH1724@julia.office.altlinux.ru
On Thu, Oct 16, 2003 at 12:44:02PM +0400, Alexey Tourbin wrote:
> Hi there,
> Here is the problem I have discovered as I tried to build Perl-RPM-0.40.

> $ gcc -I/usr/lib/perl5/i386-linux/CORE test0.c
> $ gcc -I/usr/lib/perl5/i386-linux/CORE test1.c
> test1.c: In function `main':
> test1.c:7: syntax error before '}' token
> $

> +# 4 "test1.c" 2
>  int main()
>  {
>          SV* errSV;
> -        (({}), (errSV)->sv_flags |= (0x00040000|0x04000000));
> +        (({((void) ((!((errSV)->sv_flags & 0x00080000) || !((XRV*) (errSV)->sv_any)->xrv_rv) ? 0 : (__assert_fail ("!((errSV)->sv_flags & 0x00080000) || !((XRV*) (errSV)->sv_any)->xrv_rv", "test1.c", 7, __PRETTY_FUNCTION__), 0)))}), (errSV)->sv_flags |= (0x00040000|0x04000000));
>  }

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

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