g++ doesn't fail for non existing include files with -MMD but not with -MD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

today I noticed that gcc doesn't stop with an error in all cases. Example:

$ cat test.cpp 
#include <does_not_exist.h>

int main()
{
  return 0;
}

$ g++ -c test.cpp -MD
test.cpp:1:28: error: does_not_exist.h: No such file or directory

This is expected. But using -MMD it outputs only a warning:

$ g++ -c test.cpp -MMD
test.cpp:1:28: warning: does_not_exist.h: No such file or directory

I noticed this problem because a project compiled fine in Eclipse (IIRC even
without warnings or I didn't noticed them) and failed with another build
system. Eclipse used -MMD beside other options, the other build system not :-)) 

Shouldn't gcc always complain with an error?

Version 4.3.4 and older are affected.

Jens

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux