This is the mail archive of the gcc-help@gcc.gnu.org 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]

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


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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]