B::C with optimization level 4 ignores $/ = undef

0 views
Skip to first unread message

Heinz Knutzen

unread,
Aug 15, 2010, 6:30:27 PM8/15/10
to perl-c...@googlegroups.com
This test program fails with B::C and optimization level 4.

test5.pl
=====
$/ = undef;
open FILE, 'test5.txt';
my $first = <FILE>;
my $rest = <FILE>;
print "1:\n$first";
print "2:\n$rest";
=====

test5.txt
=====
line1
line2
=====

Expected output:
$ perl test5.pl
1:
line1
line2
2:

With B::C and optimization level 4 the assignment to $/ seems to be ignored.
$ perlcc -o test5 -Wb=-O4 test5.pl
pccmfI__.c: In function ‘perl_init_aaaa’:
pccmfI__.c:324: warning: assignment from incompatible pointer type
pccmfI__.c:356: warning: assignment from incompatible pointer type
pccmfI__.c:375: warning: assignment from incompatible pointer type
pccmfI__.c:386: warning: assignment from incompatible pointer type
pccmfI__.c:437: warning: assignment from incompatible pointer type
pccmfI__.c:476: warning: assignment from incompatible pointer type
pccmfI__.c:526: warning: assignment from incompatible pointer type
$ ./test5
1:
line1
2:
line2

Used versions:
- perl v5.10.1 (*) built for i486-linux-gnu-thread-mult
(from Ubuntu 10.04)
- B::C version 1.27

--
Heinz Knutzen

Reply all
Reply to author
Forward
0 new messages