Do: touch test.o gcc -### test.o And you will get a warning about an unused linker file which is not true.
Mine, I patch in progress.
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2003-11/msg02296.html>.
I don't like changing the meaning of linker_was_run like that. Better you should change the place that emits the warning.
Oh, also, consider gcc -### -c foo.c -lm which should still issue the warning.
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?
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
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 -###.
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.
Created attachment 5282 [details] Patch to fix this Just increment execution_count when verbose_only_flag is true.
Subject: Bug 13211 CVSROOT: /cvs/gcc Module name: gcc Changes by: pinskia@gcc.gnu.org 2003-12-06 03:47:56 Modified files: gcc : ChangeLog gcc.c Log message: 2003-12-05 Andrew Pinski <pinskia@physics.uc.edu> PR driver/13211 * gcc.c (execute) Increment execution_count when returning early because verbose_only_flag is true. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.1935&r2=2.1936 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/gcc.c.diff?cvsroot=gcc&r1=1.397&r2=1.398
Subject: Bug 13211 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: pinskia@gcc.gnu.org 2003-12-06 03:50:28 Modified files: gcc : gcc.c ChangeLog Log message: 2003-12-05 Andrew Pinski <pinskia@physics.uc.edu> PR driver/13211 * gcc.c (execute) Increment execution_count when returning early because verbose_only_flag is true. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/gcc.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.350.2.7&r2=1.350.2.8 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.828&r2=1.16114.2.829
Fixed for 3.3.3 and 3.4.