Sender: "Rolf Campbell" Message-ID: <3769003C.F782545A@americasm01.nt.com> Date: Thu, 17 Jun 1999 10:03:41 -0400 From: "Rolf Campbell" Organization: Nortel Networks X-Mailer: Mozilla 4.6 [en] (X11; I; HP-UX B.10.20 9000/712) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp To: djgpp AT delorie DOT com Subject: Re: #define and lines References: <199906162123 DOT XAA01508 AT acp3bf DOT physik DOT rwth-aachen DOT de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com 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