Re: macro warnings in Xcode 4.6
Re: macro warnings in Xcode 4.6
- Subject: Re: macro warnings in Xcode 4.6
- From: Jeffrey Walton <email@hidden>
- Date: Wed, 30 Jan 2013 13:00:48 -0500
On Wed, Jan 30, 2013 at 1:34 AM, Chris Lattner <email@hidden> wrote:
>
> On Jan 29, 2013, at 3:41 PM, James Walker <email@hidden> wrote:
>
>> I tried turning on -Weverything in Xcode 4.6, and here are a couple of warnings I didn't understand.
>>
>> First, whenever I use a variadic macro (e.g., #define FOO(...)), I get a warning saying "variadic macros are a C99 feature". My C and C++ language dialects are set to "Compiler Default". According to Quick Help, Compiler Default currently means GNU99, which implies C99. So why am I being warned about it?
>
> In this case, it is likely because you are building your C++ code in C++'98 mode. C++'98 does not include a C99 preprocessor. To specifically opt-into this, you'll want to turn on C++'11.
>
>> Second, every time I use "bool", there's a warning "disabled expansion of recursive macro", with a reference to stdbool.h which says #define bool bool if __GNUC__ is defined.
>
> We'll look into it, thanks!
Apple or LLVM is also defining __GXX_EXPERIMENTAL_CXX0X__ (or was).
We've got code in the field that works around as follows (for a custom
C++ allocator):
// http://code.google.com/p/owasp-esapi-cplusplus/issues/detail?id=11
#if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
// Why is Apple defining __GXX_EXPERIMENTAL_CXX0X__
# if !defined(ESAPI_OS_APPLE)
template<typename U, typename... Args>
void construct(U* p, Args&&... a)
{
::new ((void*)p) U(std::forward<Args>(a)...);
}
...
# endif
#endif
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden