From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38119 invoked by alias); 5 Jul 2015 17:01:45 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 38085 invoked by uid 48); 5 Jul 2015 17:01:40 -0000 From: "f.heckenbach@fh-soft.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug driver/57951] -MG doesn't work with -MD Date: Sun, 05 Jul 2015 17:01:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: driver X-Bugzilla-Version: 4.7.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: f.heckenbach@fh-soft.de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg00361.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57951 --- Comment #2 from Frank Heckenbach --- 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