This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
g++ doesn't fail for non existing include files with -MMD but not with -MD
- From: Jens Seidel <jensseidel at users dot sf dot net>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 12 Nov 2009 17:49:51 +0100
- Subject: 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