Found using gcc 3.4.2 on Fedora Core 3: $ gcc -g3 -M -MT hello. -MF hello.d hello.c # 1 "/home/viz/src//" $
The line '# 1 "/home/viz/src//"' should not be generated. Verified that the problem still exists in 3.4.3. $ cat hello.c #include <stdio.h> int main () { printf("Hello\n"); } $ gcc -v -Wall -g3 -M -MT hello. -MF hello.d hello.c Reading specs from /usr/local/lib/gcc/x86_64-unknown-linux-gnu/3.4.3/specs Configured with: ./configure Thread model: posix gcc version 3.4.3 /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/3.4.3/cc1 -E -quiet -v -M -MF hello.d -MT hello. -dD hello.c -mtune=k8 -Wall -fworking-directory ignoring nonexistent directory "NONE/include" ignoring nonexistent directory "/usr/local/lib/gcc/x86_64-unknown-linux-gnu/3.4.3/../../../../ x86_64-unknown-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/local/lib/gcc/x86_64-unknown-linux-gnu/3.4.3/include /usr/include End of search list. # 1 "/home/viz/src//" $ Workaround: Don't use the -g3 option. -- Summary: Using -M -MT ... -MF ... with -g3 generates preprocess line to stdout Product: gcc Version: 3.4.2 Status: UNCONFIRMED Severity: normal Priority: P2 Component: preprocessor AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ben at pathscale dot com CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20770