On Sep 26, 2006, at 5:48 PM, Ian Lance Taylor wrote:
So I don't understand what the issue is.  Can you give an example?

mrs $ cat subdirectory/limits.h
//
// bogus limits.h header should never be included
//

#error "including limits.h from the wrong place"
mrs $ gcc  -iquotesubdirectory  t.c
In file included from /usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include/ syslimits.h:7, from /usr/lib/gcc/powerpc-apple-darwin8/4.0.1/ include/limits.h:11,
                 from t.c:1:
subdirectory/limits.h:5:2: error: #error "including limits.h from the wrong place"
mrs $ gcc  -iquotesubdirectory  -I- t.c -c
cc1: note: obsolete option -I- used, please use -iquote instead
mrs $ cat t.c
#include <limits.h>

Here, you can see the right limits.h file is included from t.c, as we'd expect, but that the wrong one is included from syslimits.h:

$ gcc  -iquotesubdirectory  t.c -E
# 1 "t.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "t.c"
# 1 "/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include/limits.h" 1 3 4
# 11 "/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include/limits.h" 3 4
# 1 "/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include/syslimits.h" 1 3 4






# 1 "subdirectory/limits.h" 1 3 4
# 8 "/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include/syslimits.h" 2 3 4
# 12 "/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include/limits.h" 2 3 4
# 1 "t.c" 2


Side note, this stuff makes my head hurt. Maybe it is just a trivial bug in some logic somewhere, and these aren't the desired/documented semantics.

Reply via email to