[perl #34991] More const weirdness

0 views
Skip to first unread message

Nick Glencross

unread,
Apr 14, 2005, 6:12:00 PM4/14/05
to bugs-bi...@rt.perl.org
# New Ticket Created by Nick Glencross
# Please include the string: [perl #34991]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34991 >


Here's another odd one, which looks const-related. Uncommenting the '+='
line causes a compile error when 'c' is subsequently used.

If the const is made a float, then the problem goes away. Bringing the
const into the function, it compiles, but the result is wrong (it looks
like perhaps it doesn't expand the const, and the tracing shows that it
adds 0).

Regards,

Nick

p.s. If this is drawing focus away from important topics, please let me
know. I recall that there was debate about macros etc., but I can't
remember if consts were here to stay or not...


.const int c = 12

.sub test

.local float a
a = 96

# Uncomment this line, and the c symbol is 'forgotten'
# a += c

print a
print_newline
print c
print_newline

end
.end

Reply all
Reply to author
Forward
0 new messages