This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug preprocessor/20770] New: Using -M -MT ... -MF ... with -g3 generates preprocess line to stdout

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 () {
$ 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/../../../../
#include "..." search starts here:
#include <...> search starts here:
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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]