On Apr 11, 2006, at 22:48, Nicholas Clark wrote:
On Tue, Apr 11, 2006 at 06:15:32PM +0200, Leopold Toetsch wrote:
No. Above replaced line was definitely bogus. CONST_STRING is a macro
that takes *one* string constant and it has likely to be own it's own
line.
Ah. Thanks for the explanation.
One literal string constant?
Yup.
find . -type f | grep -v text-base | xargs grep CONST_STR | grep -v
'")'
finds
./src/library.c: *prefix_str = CONST_STRING(interpreter,
pwd);
which smells fishy:
Yeah. It's rather easy to forget, what CONST_STRING does or mix it with
const_string.
If it's supposed to only ever be a literal "" string constant, Chip
suggested
a neat trick that we're now using in Perl 5 - in the macro get the C
pre-processor to append "" to the argument. The only thing that that's
valid
for is a literal string.
Great. Easy. And indeed it should catch all wrong usage.
Nicholas Clark
Thanks,
leo