[GCC-XML] Snow Leopard and CoreFoundation.h doesn't parse
Brad King
brad.king at kitware.com
Mon Jul 12 08:25:46 EDT 2010
On 07/10/2010 02:18 PM, Jason Roelofs wrote:
> $ gccxml -F/System/Library/Frameworks/ gccxml_test.cpp In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43, from gccxml_test.cpp:1: /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h:147: error: format string argument not a
> string type
>
> I don't know what Apple's gcc has different
They did patch gcc to add some Apple-specific things. In this case
they taught it to recognize CFStringRef as a string argument suitable
for use with the __attribute__((format_arg(A))) attribute, but gccxml
will only recognize "char*" arguments.
> but I've run into quite a few people who have had this issue,
> not necessarily with gccxml but with non-apple gcc compilers in general.
> Has anyone here run into this and come up with a solution other than
> patching the code I'm parsing to not require these files?
Try creating a "CoreFoundation/CFString.h" header in your own custom
include directory, with this content:
#include_next <CoreFoundation/CFString.h>
#ifdef __GCCXML__
#undef CF_FORMAT_ARGUMENT
#define CF_FORMAT_ARGUMENT(A)
#endif
-Brad
More information about the gccxml
mailing list