In my SAX xml parsing callback (XCode 4, LLVM), I am doing a lot of calls to this type of code:
static const char* kFoo = \"Bar\";
void SaxCallBack(char* sa
In general you can't count on it. However, you could use 'sizeof' and apply it to a string literal. Of course, this mean that you can't define 'kFoo' the way it originally was defined.
The following should work on all compilers and on all optimization levels.
#define kFoo "..."
... strcmp(... sizeof(kFoo))