public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug driver/57951] New: -MG doesn't work with -MD
@ 2013-07-21 19:28 f.heckenbach@fh-soft.de
  2014-02-06 22:24 ` [Bug driver/57951] " douglas at halo dot gen.nz
  2015-07-05 17:01 ` f.heckenbach@fh-soft.de
  0 siblings, 2 replies; 3+ messages in thread
From: f.heckenbach@fh-soft.de @ 2013-07-21 19:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57951
           Summary: -MG doesn't work with -MD
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: f.heckenbach@fh-soft.de

This was reported as Debian bug #593086 several years ago ...

% gcc -MD -MG foo.c
cc1: error: -MG may only be used with -M or -MM

(Contents of source file don't matter.)

According to the manual

  `-MD' is equivalent to `-M -MF FILE', except that `-E' is not implied.

so I figure it should work. (It did in previous versions, e.g. 4.1.2)

There seems to be no work-around since "-M" implies "-E".

I guess the driver only needs to be told that "-MD" is also OK for "-MG" to
work since it implies "-M".


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

* [Bug driver/57951] -MG doesn't work with -MD
  2013-07-21 19:28 [Bug driver/57951] New: -MG doesn't work with -MD f.heckenbach@fh-soft.de
@ 2014-02-06 22:24 ` douglas at halo dot gen.nz
  2015-07-05 17:01 ` f.heckenbach@fh-soft.de
  1 sibling, 0 replies; 3+ messages in thread
From: douglas at halo dot gen.nz @ 2014-02-06 22:24 UTC (permalink / raw)
  To: gcc-bugs

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

Douglas Bagnall <douglas at halo dot gen.nz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |douglas at halo dot gen.nz

--- Comment #1 from Douglas Bagnall <douglas at halo dot gen.nz> ---
Also present in 4.8.1, and it also affects -MMD as you might expect.


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

* [Bug driver/57951] -MG doesn't work with -MD
  2013-07-21 19:28 [Bug driver/57951] New: -MG doesn't work with -MD f.heckenbach@fh-soft.de
  2014-02-06 22:24 ` [Bug driver/57951] " douglas at halo dot gen.nz
@ 2015-07-05 17:01 ` f.heckenbach@fh-soft.de
  1 sibling, 0 replies; 3+ messages in thread
From: f.heckenbach@fh-soft.de @ 2015-07-05 17:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57951

--- Comment #2 from Frank Heckenbach <f.heckenbach@fh-soft.de> ---
Another bug that may be related to this one (and certainly depends
on it), originally reported as Debian bug #613551:

Tested with gcc-4.1 (apparently the last version that did allow "-MD -MG"):

When using "-MG", gcc doesn't give an error message, neither exits
with nonzero status when included files don't exist, even if not
only preprocessing ("-M"), but also when actually compiling ("-MD").

This can, in extreme cases, lead to miscompilation (if the included
file e.g. redefines existing macros), usually only to surprising
errors (the results of missing declarations from the include file,
without a leading hint to its absence).

% cat foo.c
#include "non-existing-file"
% gcc -MD -MG -c foo.c
% echo $?
0


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

end of thread, other threads:[~2015-07-05 17:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-21 19:28 [Bug driver/57951] New: -MG doesn't work with -MD f.heckenbach@fh-soft.de
2014-02-06 22:24 ` [Bug driver/57951] " douglas at halo dot gen.nz
2015-07-05 17:01 ` f.heckenbach@fh-soft.de

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).