[cfe-dev] New warning for mismatched include case

Jason Haslam jason.haslam at gmail.com
Wed Jul 18 15:09:23 PDT 2012

The attached (incomplete proof-of-concept) patch provides a new warning that fires on case-insensitive file systems when the case of the file name in the #include directive doesn't match the case of the file name on disk. The idea is to avoid broken commits that fail to build on case-sensitive file systems. For example:

jason$ ls
test.cpp test.h
jason$ cat test.cpp
#include "Test.h"
jason$ clang++ -fsyntax-only test.cpp 
test.cpp:1:10: warning: include case does not match the case of the file on disk
#include "Test.h"
1 warning generated.

What do you think? Is this desirable? Does the direction look right?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: include_case.diff
Type: application/octet-stream
Size: 2178 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120718/5bea7615/attachment.obj>

More information about the cfe-dev mailing list