New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
h2ph generates incorrect code for '#if defined A || defined B' #8449
Comments
From jvdias@redhat.comCreated by jvdias@redhat.comFor cpp statements like : #if defined A || defined B h2ph would generate the code : if(defined (defined(&A) ? &A : 0) || defined (defined(&B) ? &B : 0)) { which is tautologous, as defined(0) is always true . This turns out to cause real problems on the Linux ppc64 platform, $ perl -e 'require "sys/socket.ph";' Because h2ph generated this code in ../bits/endian.ph: The problem does not happen if the 'defined..' conditions are in parentheses - A trivial fix for this is to simply replace the ': 0' with ': undef' in Inline Patch--- perl-5.8.8/utils/h2ph.PL~ 2006-01-12 17:55:04.000000000 -0500
+++ perl-5.8.8/utils/h2ph.PL 2006-05-11 13:50:04.000000000 -0400
@@ -514,7 +514,7 @@
}
} else {
if ($inif && $new !~ /defined\s*\($/) {
- $new .= '(defined(&' . $id . ') ? &' . $id . ' : 0)';
+ $new .= '(defined(&' . $id . ') ? &' . $id . ' : undef)';
} elsif (/^\[/) {
$new .= " \$$id";
} else {
Thanks & Regards, Jason Vas Dias <jvdias@redhat.com> Perl Info
|
@rgs - Status changed from 'new' to 'resolved' |
From @rgsJason Vas Dias (via RT) wrote:
Thanks, applied to bleadperl as change #28225.
(To Nicholas:) I concur. |
Migrated from rt.perl.org#39130 (status was 'resolved')
Searchable as RT39130$
The text was updated successfully, but these errors were encountered: