[CPP patch]: -M default name
Neil Booth
neil@daikokuya.demon.co.uk
Thu Feb 8 23:40:00 GMT 2001
Zack Weinberg wrote:-
> This sounds plausible enough, although rather horrifying. But we knew
> the specs were horrifying.
>
> Do you think you can come up with a way to test this stuff?
No - I don't know how to do the necessary scripting in the dejagnu
framework - advice welcome.
The patch below is what I'll commit; the previously posted patch had
its braces all in the wrong place.
[Incidentally, testing this has shown up another minor problem - if
cpp0 reports an error, we delete the .d file as expected. If the
driver reports an error (e.g. "No input files"), we don't delete
the %W files. I won't attempt to fix this.]
Neil.
* gcc.c (cpp_options): Delete .d files on error. Don't delete
.o files when using the -M options.
Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.204
diff -u -p -r1.204 gcc.c
--- gcc.c 2001/02/07 18:58:05 1.204
+++ gcc.c 2001/02/09 07:31:41
@@ -593,8 +593,9 @@ static const char *cpp_options =
"%{C:%{!E:%eGNU C does not support -C without using -E}}\
%{std*} %{nostdinc*}\
%{C} %{v} %{I*} %{P} %{$} %I\
- %{MD:-M -MF %{!o: %b.d}%{o*:%.d%*}} %{MMD:-MM -MF %{!o: %b.d}%{o*:%.d%*}}\
- %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{M|MD|MM|MMD:%{o*:-MQ %*}}\
+ %{MD:-M -MF %W{!o: %b.d}%W{o*:%.d%*}}\
+ %{MMD:-MM -MF %W{!o: %b.d}%W{o*:%.d%*}}\
+ %{M} %{MM} %W{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{M|MD|MM|MMD:%{o*:-MQ %*}}\
%{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
%{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
@@ -606,7 +607,7 @@ static const char *cpp_options =
%{fleading-underscore} %{fno-leading-underscore}\
%{fno-operator-names} %{ftabstop=*} %{remap}\
%{g3:-dD} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*&U*&A*} %{i*} %Z %i\
- %{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}}";
+ %{E:%{!M*:%W{o*}}}";
/* NB: This is shared amongst all front-ends. */
static const char *cc1_options =
More information about the Gcc-patches
mailing list