Mail Archives: djgpp/1999/06/17/10:04:25
Hans-Bernhard Broeker wrote:
> In article <3768057F DOT 55A3A47A AT americasm01 DOT nt DOT com> you wrote:
> > I am actually using the C preprocessor to process html files.
> Ah, so my private guess turns out to be correct: a lassical case of
> 'wrong tool for the task'. Spoken figuratively, you're using a
> chainsaw to hammer in nails, and now you come to us and complain that
> the chainsaw doesn't get them in as straight as you want them.
You're right, but it does do everything I require, and it's a tool I'm
familiar with. The house I build with the chainsaw will still stand even if
some of the nails are crooked. I'm not really complaining, just asking.
> > That's not entirely true. You can use -DMAC=#define on a
> > command-line to make a macro that expands to a preprocessor
> > directive.
>
> No. With a standard-conforming compiler and preprocessor, you
> can't. Or, more precisely: you can generate the string, but it won't
> become a preprocessor command. I've checked this (with gcc on a Linux
> box), just be sure I didn't misread K&R2 (in the middle of section
> A.12.3) on this issue. In the words of the C9x draft standard:
>
> As to using '-Dmacro': that's 100% equivalent to adding a line
> '#define macro' at the very start of the source text.
You're right on both topics, and the reason why I never noticed is
because the c compiler silently ignores lines beginning with "#define".
(which I think is a useful quality)
--
-Rolf Campbell (39)3-6318
- Raw text -