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

assert.h breaks perl.h

Thread Next
From:
Alexey Tourbin
Date:
October 16, 2003 01:44
Subject:
assert.h breaks perl.h
Message ID:
20031016084402.GY1724@julia.office.altlinux.ru
Hi there,
Here is the problem I have discovered as I tried to build Perl-RPM-0.40.

$ cat test0.c
#include "EXTERN.h"
#include "perl.h"
int main()
{
        SV* errSV;
        SvPOK_on(errSV);
}

$ cat test1.c
#include "EXTERN.h"
#include "perl.h"
#include <assert.h>
int main()
{
        SV* errSV;
        SvPOK_on(errSV);
}

$ 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
$

Here is the difference (zsh syntax):

$ diff -u =(gcc -E -I/usr/lib/perl5/i386-linux/CORE test0.c) =(gcc -E -I/usr/lib/perl5/i386-linux/CORE test1.c) | tail
+
+
+
+# 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));
 }

It worked fine with perl-5.8.0, though.
Linux 2.4.22, glibc 2.2.5, gcc 3.2.3, perl 5.8.1.

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