Seeming flaw in Xcode 10

Perry E. Metzger perry at piermont.com
Sun Nov 11 22:36:03 UTC 2018


As some of you are aware, XCode 10 no longer searches SDK include
directories for C headers specified with " marks, as in

#include "stdio.h"

I happened to be reading the C standard (don't ask why) and I've
discovered this new behavior is wrong and the original behavior was
correct. To wit, in C11, 6.10.2 Source file inclusion, paragraph 3:

   A preprocessing directive of the form
   # include "q-char-sequence" new-line
   causes the replacement of that directive by the entire contents of
   the source file identified by the specified sequence between the "
   delimiters. The named source file is searched for in an
   implementation-defined manner. If this search is not supported, or
   if the search fails, the directive is reprocessed as if it read
   # include <h-char-sequence> new-line
   with the identical contained sequence (including > characters, if
   any) from the original directive.

In other words, if you say "stdio.h", and that file isn't found in the
search path for "-quoted include file names, the compiler is to search
as though it had been written with a <name.h> include.

I know some of our group are Apple employees. Does anyone know how to
get in touch with the Xcode team to inform them that this change of
behavior is apparently nonstandard, and breaks the expectations of
standards conforming C code?

Perry
-- 
Perry E. Metzger		perry at piermont.com


More information about the macports-dev mailing list