On Fri, 13 Apr 2001, Frank Heckenbach wrote:
Russ Whitaker wrote:
On Fri, 13 Apr 2001, Frank Heckenbach wrote:
Russ Whitaker wrote:
Since CPP is in use elsewhere,
Macro substitution occurs only on whole tokens, not on parts of identifiers, so that's no problem.
True, but like I said, was just being cautious. Last thing I wanted was some side effect to sneak in undetected.
Well, let me say this again:
20010409 is broken, but only because the define is before, not after the includes. The name of the define (CPP) and the way it's used (outside of quoted strings) seems to be correct. Simply moving the define after the includes should work (patch below; this will also be in the next GPC version). Why don't you just try it?
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
If you are still not convinced:
1. gunzip the attachment.
2. apply the appropiate diff file from below to the attachment
3. compile gpc using patched attachment, install, run test suite
4. checkmate
Russ ________________________________________________________________________ diff file #1:
*** gpc.c.orig Fri Apr 13 14:32:05 2001 --- gpc.c Fri Apr 13 14:37:30 2001 *************** *** 692,697 **** --- 692,703 ----
#ifdef EGCS95
+ #ifdef GPC_2_94_3 + #define czz cpp0 + #else + #define czz cpp + #endif + static struct compiler default_compilers[] = { /* Add lists of suffixes of known languages here. If those languages *************** *** 710,716 **** {"@c", { #if USE_CPPLIB ! "%{E|M|MM:cpp -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\ %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ --- 716,722 ---- {"@c", { #if USE_CPPLIB ! "%{E|M|MM:czz -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\ %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ *************** *** 746,752 **** %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\ %{!pipe:%g.s} %A\n }}}}" #else /* ! USE_CPPLIB */ ! "cpp -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\ %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ --- 752,758 ---- %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\ %{!pipe:%g.s} %A\n }}}}" #else /* ! USE_CPPLIB */ ! "czz -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\ %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ *************** *** 774,780 **** #endif /* ! USE_CPPLIB */ }}, {"-", ! {"%{E:cpp -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\ %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ --- 780,786 ---- #endif /* ! USE_CPPLIB */ }}, {"-", ! {"%{E:czz -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\ %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ *************** *** 792,798 **** {".h", {"@c-header"}}, {"@c-header", {"%{!E:%eCompilation of header file requested} \ ! cpp %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2}\ --- 798,804 ---- {".h", {"@c-header"}}, {"@c-header", {"%{!E:%eCompilation of header file requested} \ ! czz %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2}\ *************** *** 823,829 **** %i %A\n }}}}"}}, {".S", {"@assembler-with-cpp"}}, {"@assembler-with-cpp", ! {"cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG} %{trigraphs}\ -$ %{!undef:%p %P} -D__ASSEMBLER__ \ --- 829,835 ---- %i %A\n }}}}"}}, {".S", {"@assembler-with-cpp"}}, {"@assembler-with-cpp", ! {"czz -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG} %{trigraphs}\ -$ %{!undef:%p %P} -D__ASSEMBLER__ \ ____________________________________________________________________________ diff file #2
*** gpc.c.orig Fri Apr 13 14:32:05 2001 --- gpc.c Fri Apr 13 14:43:26 2001 *************** *** 690,695 **** --- 690,702 ----
/* The default list of file name suffixes and their compilation specs. */
+ + #ifdef GPC_2_94_3 + #define czz cpp0 + #else + #define czz cpp + #endif + #ifdef EGCS95
static struct compiler default_compilers[] = *************** *** 710,716 **** {"@c", { #if USE_CPPLIB ! "%{E|M|MM:cpp -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\ %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ --- 717,723 ---- {"@c", { #if USE_CPPLIB ! "%{E|M|MM:czz -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\ %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ *************** *** 746,752 **** %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\ %{!pipe:%g.s} %A\n }}}}" #else /* ! USE_CPPLIB */ ! "cpp -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\ %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ --- 753,759 ---- %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\ %{!pipe:%g.s} %A\n }}}}" #else /* ! USE_CPPLIB */ ! "czz -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\ %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ *************** *** 774,780 **** #endif /* ! USE_CPPLIB */ }}, {"-", ! {"%{E:cpp -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\ %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ --- 781,787 ---- #endif /* ! USE_CPPLIB */ }}, {"-", ! {"%{E:czz -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\ %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ *************** *** 792,798 **** {".h", {"@c-header"}}, {"@c-header", {"%{!E:%eCompilation of header file requested} \ ! cpp %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2}\ --- 799,805 ---- {".h", {"@c-header"}}, {"@c-header", {"%{!E:%eCompilation of header file requested} \ ! czz %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2}\ *************** *** 823,829 **** %i %A\n }}}}"}}, {".S", {"@assembler-with-cpp"}}, {"@assembler-with-cpp", ! {"cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG} %{trigraphs}\ -$ %{!undef:%p %P} -D__ASSEMBLER__ \ --- 830,836 ---- %i %A\n }}}}"}}, {".S", {"@assembler-with-cpp"}}, {"@assembler-with-cpp", ! {"czz -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG} %{trigraphs}\ -$ %{!undef:%p %P} -D__ASSEMBLER__ \ *************** *** 859,865 **** {".c", {"@c"}}, {"@c", { ! "cpp -lang-c%{ansi:89} %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ -undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\ --- 866,872 ---- {".c", {"@c"}}, {"@c", { ! "czz -lang-c%{ansi:89} %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ -undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\ *************** *** 881,887 **** %{!pipe:%g.s} %A\n }}}}" }}, {"-", ! {"%{E:cpp -lang-c%{ansi:89} %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ -undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\ --- 888,894 ---- %{!pipe:%g.s} %A\n }}}}" }}, {"-", ! {"%{E:czz -lang-c%{ansi:89} %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ -undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\ *************** *** 894,900 **** %{!E:%e-E required when input is from standard input}"}}, {".m", {"@objective-c"}}, {"@objective-c", ! {"cpp -lang-objc %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ -undef -D__OBJC__ -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\ --- 901,907 ---- %{!E:%e-E required when input is from standard input}"}}, {".m", {"@objective-c"}}, {"@objective-c", ! {"czz -lang-objc %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ -undef -D__OBJC__ -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\ *************** *** 918,924 **** {".h", {"@c-header"}}, {"@c-header", {"%{!E:%eCompilation of header file requested} \ ! cpp %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ -undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\ --- 925,931 ---- {".h", {"@c-header"}}, {"@c-header", {"%{!E:%eCompilation of header file requested} \ ! czz %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ -undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\ *************** *** 946,952 **** %i %A\n }}}}"}}, {".S", {"@assembler-with-cpp"}}, {"@assembler-with-cpp", ! {"cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG} %{trigraphs}\ -undef -$ %{!undef:%p %P} -D__ASSEMBLER__ \ --- 953,959 ---- %i %A\n }}}}"}}, {".S", {"@assembler-with-cpp"}}, {"@assembler-with-cpp", ! {"czz -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG} %{trigraphs}\ -undef -$ %{!undef:%p %P} -D__ASSEMBLER__ \