This is the mail archive of the gcc@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: format argument does not have string type



On Apr 29, 2009, at 9:58 PM, Jack Howarth wrote:


  Does anyone understand why Apple's gcc-4.2 compiler in
Xcode 3.1.2 accepts the following code...

typedef const struct __CFString * CFStringRef;
typedef struct __CFBundle *CFBundleRef;

extern
CFStringRef CFBundleCopyLocalizedString(CFBundleRef bundle, CFStringRef key, CFStringRef value, CFStringRef tableName) __attribute__((format_arg(2)));


and FSF gcc 4.3 and 4.4 produces the error message...

gcc-4 testcase.c -F. -S -o test.s
testcase.c:5: error: format string argument not a string type

...instead? Is this a language violation that Apple ignores or
do they have more capabilities in their attributes than FSF gcc?
Thanks in advance for any clarification on whether this merits
an enhancement request for gcc 4.5.

Apple GCC understands "Core Foundation" strings, which is what __CFString is. I don't know all the details, but the code is open source through open darwin.


-Chris



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