This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/31851] New: -MT doesn't overwrite the default target when used with -M(M)D and -o
- From: "c dot matuszewski at gmx dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 May 2007 07:43:41 -0000
- Subject: [Bug preprocessor/31851] New: -MT doesn't overwrite the default target when used with -M(M)D and -o
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Suppose, you have the following C-File (input.c), empty.h is just an empty
file:
#include "empty.h"
void dummy(void) {
}
Issue the command:
gcc -c input.c -MD -MT foo.o -o input.o
The content of input.d is:
foo.o input.o: input.c empty.h
but I would expect:
foo.o: input.c empty.h
which also is the output of "gcc -c input.c -MD -MT foo.o"
The documentation says:
-MD: [...] if used without `-E', each `-o' is understood to specify a target
object file.
OK, but:
-MT: [...] An `-MT' option will set the target to be exactly the string you
specify.
I would prefer that -MT always overwrites the targets (as it does with -M and
-MM).
I tested also with gcc 3.4.4 and 3.4.6 and the behaviour is the same as with
4.1.1
--
Summary: -MT doesn't overwrite the default target when used with
-M(M)D and -o
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: preprocessor
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: c dot matuszewski at gmx dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31851