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]

RE: Problems with #import <stdarg.h>


Hi Ronald,

I believe* all the operating system provided headers (such as the Standard C Library ones) expected to be #include'd (which uses the C protocol for the preprocessor), not #import'd (the ObjC protocol for the preprocessor).

Using #import can interfere with their multi-include logic.  The reason for the multi-include logic is historical/legacy, evolutionary, backwards compatibility, and also involves ISO 9899 standardization (both 1989 and 1999).  And for some headers, which are more intimately tied to the operating system than the Standard C Library, there may be some POSIX (IEEE Std 1003) contortions as well or UNIX 2003 contortions.  It's hard to please everyone.

In theory, they could be made to be #import savvy as well, but those headers are really C headers, not ObjC headers.  (Often they have allowances incorporated to be used as-is for C++.  But C++ compilation units really should use <cstdarg> and <cstdio> rather than the raw C <stdarg.h> and <stdio.h> anyway.)

HTH,
--Eljay

* I may be mistaken.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]