13211 – using -###, warns about unused linker file (original) (raw)
Description Drea Pinski 2003-11-27 07:23:49 UTC
Do: touch test.o gcc -### test.o And you will get a warning about an unused linker file which is not true.
Comment 1 Drea Pinski 2003-11-27 07:24:23 UTC
Mine, I patch in progress.
Comment 3 Zack Weinberg 2003-12-02 01:19:04 UTC
I don't like changing the meaning of linker_was_run like that. Better you should change the place that emits the warning.
Comment 4 Zack Weinberg 2003-12-02 01:20:03 UTC
Oh, also, consider
gcc -### -c foo.c -lm
which should still issue the warning.
Comment 5 Drea Pinski 2003-12-02 01:29:42 UTC
Zack if I change where the warning happens, then the test you mentioned does not warn at all. What about this, increment the value of execution_count when verbose_only_flag is set?
Comment 6 Zack Weinberg 2003-12-02 01:50:22 UTC
Subject: Re: using -###, warns about unused linker file
I don't know if that's right. What you need is a way to say that the linker would have been run if not for -###.
zw
Comment 7 Jim Wilson 2003-12-03 03:08:18 UTC
I started looking at this because I thought it was an unreviewed patch. There was no response to the gcc-patches message.
The suggestion of incrementing execution_count when verbose_only_flag is true looks like the right solution to me. execution_count is only used for the unused linker file error message, so nothing else should be affected. It does exactly what Zack asks for, it indicates that the linker would have been run if not for -###.
Comment 8 Zack Weinberg 2003-12-03 06🔞15 UTC
Thanks for the clarification; I withdraw my objections.
It would be nice if there were a way to get the bugzilla comment box to cc: gcc-patches.
Comment 12 Drea Pinski 2003-12-06 03:51:05 UTC
Fixed for 3.3.3 and 3.4.