Reputation: 401
I am using stdio.h file in my project.
when compile time from Xcode i used
Comipler for C/C++/Objective-C: LLVM GCC 4.2
During compile time getting Conflicting types for 'sprintf' error.This is working fine in Mac OS 10.6.8 & Xcode 3.2.3 but in Mac OS 10.7.4 & Xcode 4.5 getting error? please help me?
this is code in Mac OS X 10.7.4
__BEGIN_DECLS
int fseeko(FILE *, off_t, int);
off_t ftello(FILE *);
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 200112L */
#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus)
__BEGIN_DECLS
int snprintf(char * __restrict, size_t, const char * __restrict, ...) __printflike(3, 4);
int vfscanf(FILE * __restrict, const char * __restrict, va_list) __scanflike(2, 0);
int vscanf(const char * __restrict, va_list) __scanflike(1, 0);
int vsnprintf(char * __restrict, size_t, const char * __restrict, va_list) __printflike(3, 0);
int vsscanf(const char * __restrict, const char * __restrict, va_list) __scanflike(2, 0);
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) */
Upvotes: 0
Views: 1613
Reputation: 78915
The check whether the format pattern and the arguments of sprintf
and similar functions match was recently added to the compilers of XCode 4.4 (if I'm not mistaken). It's a valuable check that highlights problems in your code that went unnoticed with earlier version.
In my case, the compiler was always right. So you better fix the format pattern or convert the corresponding argument.
If you post the specific code, we can give your more specific advice.
Upvotes: 2