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

[perl #57176] Including XSUB.h before perl.h gives nasty error

Thread Next
From:
perlbug-followup
Date:
July 21, 2008 16:20
Subject:
[perl #57176] Including XSUB.h before perl.h gives nasty error
Message ID:
rt-3.6.HEAD-29759-1216661233-5.57176-75-0@perl.org
# New Ticket Created by  fawaka@gmail.com 
# Please include the string:  [perl #57176]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=57176 >



This is a bug report for perl from fawaka@gmail.com,
generated with the help of perlbug 1.35 running under perl v5.8.8.


-----------------------------------------------------------------
[Please enter your report here]

Including XSUB.h before perl.h gives nasty error

This simple program:

#include <XSUB.h>
#include <EXTERN.h>
#include <perl.h>

Will give this error for me (using the headers of perl 5.10 and gcc 4.2.3)

In file included from /home/leon/Programs/perl/perl-5.10.0/perl.h:4700,
                 from test.C:3:
/home/leon/Programs/perl/perl-5.10.0/embedvar.h:179:1: warning: "PL_madskills" redefined
In file included from test.C:1:
/home/leon/Programs/perl/perl-5.10.0/XSUB.h:421:1: warning: this is the location of the previous definition
In file included from /home/leon/Programs/perl/perl-5.10.0/perl.h:4700,
                 from test.C:3:
/home/leon/Programs/perl/perl-5.10.0/embedvar.h:349:1: warning: "PL_xmlfp" redefined
In file included from test.C:1:
/home/leon/Programs/perl/perl-5.10.0/XSUB.h:422:1: warning: this is the location of the previous definition

This used to work using perl 5.8.8. It can be solved by including XSUB.h after perl.h. A more structural solution seems to be simply removing lines 418-423 of XSUB.h (they are identical to line 4777-4782 of perl.h, they seem to be superfluous).

Regards,

Leon Timmermans

The patch:

diff -ruN perl-current/XSUB.h perl-patched/XSUB.h
--- perl-current/XSUB.h 2008-01-04 01:37:40.000000000 +0100
+++ perl-patched/XSUB.h 2008-07-21 19:02:11.000000000 +0200
@@ -415,12 +415,6 @@
 #endif

 #include "perlapi.h"
-#ifndef PERL_MAD
-#  undef PL_madskills
-#  undef PL_xmlfp
-#  define PL_madskills 0
-#  define PL_xmlfp 0
-#endif

 #if defined(PERL_IMPLICIT_CONTEXT) && !defined(PERL_NO_GET_CONTEXT) && !defined(PERL_CORE)
 #  undef aTHX


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
Site configuration information for perl v5.8.8:

Deleted to avoid confusion. The problem happens when compiling against a different version of perl than the one I'm running. What is important is that PERL_MAD was not defined during compilation.

---
Environment for perl v5.8.8:
    HOME=/home/leon
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LOGDIR (unset)
    PATH=/home/leon/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
    PERL_BADLANG (unset)
    SHELL=/bin/bash


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