Summary: | when using #include with perl -P error messages get filename and line numbers wrong. | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | David van Laatum <david> |
Component: | [OLD] Unspecified | Assignee: | Gentoo Perl team <perl> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
test script
test script include |
Description
David van Laatum
2009-06-28 03:46:42 UTC
Created attachment 195931 [details]
test script
Created attachment 195932 [details]
test script include
[13:19:55 david@mouse tmp]# cpp -E -C -fworking-directory testcode.pl | perl -npe 's|^# (\d+) "(.*)".*$|#line $1 "$2"|' - | perl -c - testcode.pl:1:2: error: invalid preprocessing directive #! Global symbol "$bla" requires explicit package name at testcode2.pl line 1. - had compilation errors. shows the correct info (plus the error caused by the #!/usr/bin/perl) [ebuild R ] dev-lang/perl-5.8.8-r5 USE="berkdb doc gdbm -build -debug -ithreads -perlsuid" 9,887 kB [ebuild R ] sys-devel/gcc-4.3.2-r3 USE="doc fortran gtk mudflap nls openmp (-altivec) -bootstrap -build (-fixed-point) -gcj (-hardened) -ip28 -ip32r10k -libffi (-multilib) -multislot (-n32) (-n64) -nocxx -nopie -objc -objc++ -objc-gc -test -vanilla" 57,645 kB Have a look at the -P description in perlrun (<http://search.cpan.org/~nwclark/perl-5.8.8/pod/perlrun.pod>). It is a known problem: | -P | | NOTE: Use of -P is strongly discouraged because of its inherent problems, | including poor portability. | ... | The problems of -P include, but are not limited to: | ... | * Script line numbers are not preserved. In 5.10 upstream adds: "It is deprecated and will be removed in a future version of Perl." Should we really investigate if a workaround fixes it in general or at least with latest gcc versions? No I suppose its pointless if its going to go.... unfortunately Filter::cpp dosn't seem to preserve the line numbers ether... |