public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug driver/22231] New: -MG ignores missing headers even with -c
@ 2005-06-29 13:54 js at linuxtv dot org
  2005-06-29 15:22 ` [Bug preprocessor/22231] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 6+ messages in thread
From: js at linuxtv dot org @ 2005-06-29 13:54 UTC (permalink / raw)
  To: gcc-bugs

I just spent half an hour to debug mysterious build failures
(make complaining about missing dependencies) in some
third party code. (The reason was a missing -Ipath.)

Given what the documentation of -MG
in the preprocessor says I'm not sure this is a real bug,
but as an enhancement request I think gcc shouldn't
pass -MG to the preprocessor if it is used in combination
with -c (or -S etc.), or produce an error (it doesn't
really make sense to use -MG with -c).

This behaviour is the same in gcc --version:
gcc-3.3 (GCC) 3.3.6 (Debian 1:3.3.6-7)
gcc-3.4 (GCC) 3.4.5 20050613 (prerelease) (Debian 3.4.4-1)
gcc-4.0 (GCC) 4.0.1 20050617 (prerelease) (Debian 4.0.0-10)

$ cat >t.c
#include "foo.h"
$ gcc -MD -c t.c
t.c:1:17: foo.h: No such file or directory
$ ls -l t.*
-rw-r--r--  1 js js 17 Jun 29 15:35 t.c
-rw-r--r--  1 js js  0 Jun 29 15:36 t.d
$ gcc -MD -MG -c t.c
$ ls -l t.*
-rw-r--r--  1 js js  17 Jun 29 15:35 t.c
-rw-r--r--  1 js js  15 Jun 29 15:35 t.d
-rw-r--r--  1 js js 637 Jun 29 15:35 t.o
$ cat t.d
t.o: t.c foo.h
$

-- 
           Summary: -MG ignores missing headers even with -c
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: driver
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: js at linuxtv dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22231


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-05-09 22:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-22231-10902@http.gcc.gnu.org/bugzilla/>
2007-01-08  1:54 ` [Bug preprocessor/22231] -MG ignores missing headers even with -c tromey at gcc dot gnu dot org
2007-01-21  3:09 ` tromey at gcc dot gnu dot org
2008-05-08 16:41 ` tromey at gcc dot gnu dot org
2008-05-09 22:18 ` tromey at gcc dot gnu dot org
2008-05-09 22:19 ` tromey at gcc dot gnu dot org
2005-06-29 13:54 [Bug driver/22231] New: " js at linuxtv dot org
2005-06-29 15:22 ` [Bug preprocessor/22231] " pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).