Russ Whitaker wrote:
On Sat, 14 Apr 2001, Frank Heckenbach wrote:
Russ Whitaker wrote:
- I really don't know what you did with czz, but if the string czz did creep into the table in the executable, you probably have inserted it within a quoted string or something (unlike my CPP macro). If you send me your file with these changes, I can perhaps find out what the problem is ...
Attached is a gzip copy of a virgin gpc.c, copied from the 20010317 release.
Below is two diff files: The first is an *exact* reproduction of what I did. The second is in case you want to try it yourself and you are *not* using gcc-2.95.x
Well, you try to use the macro inside the quoted strings like I assumed. As I said (and I think you also pointed out), this does not work. To get macro substitution, you have to put it outside of strings.
And, again, that's exactly what I did in 20010409, so I still claim this version is correct, except for the placement of the defines.
You just dug yourself into a deeper hole.
The goal is to replace cpp with cpp0 when you have GPC_2_95_3.
If you will look at the quote marks in the untouched gpc.c (from 20010317 as an example) you will discover that the cpp's in the table *are* inside quoted strings.
Reminder: the diff files in the last post are only for illustrating the problem.
I've explained this so often now, I don't what more I can say about it. So I just repeat myself...
In 20010317 (before the whole thing started), there was a number of occurrences of cpp *inside* quoted strings.
In your diffs, you renamed cpp to czz *within* the quoted strings (which clearly is a "problem" since it can't work).
In my changes (20010409), I moved it *out of* the quoted strings and renamed it to CPP. E.g.:
[...] - "%{E|M|MM:cpp -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\ + "%{E|M|MM:" CPP " -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\ [...]
CPP is a macro which expands to either "cpp" or "cpp0" (depending on the GCC version), including the quotes.
So the line above expands to (using gcc-2.95.3):
"%{E|M|MM:" "cpp0" " -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\
which in C is the same as:
"%{E|M|MM:cpp0 -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\
OK, so maybe you're not familiar with how macros and string constants work in C (as a Pascal programmer, that's no shame ;-). But then, why don't you just try it rather than claiming that it doesn't work?
Frank