I have just changed a compiler option from 4.0 to 4.2.
Now I get an error:
jump to case label crosses initialization of 'const char* selectorName'
It works fine in 4.0
Any ideas?
Xcode 4 exploits this modular approach to provide features such as improved syntax highlighting and to suggest fixes to common coding errors. As of writing GCC remains the default compiler for Xcode 3 but with the release of Xcode 4 the default compiler for new projects has changed to LLVM-GCC.
The GNU compiler collection, GCC, is one of the most famous open-source tools in existence. It is a tool that can be used to compile multiple languages and not just C or C++. The current version of GCC, GCC 11, has full support for C++17 core language features as well as C++17 library features.
In Xcode, the LLVM compiler uses the Clang front end (a C-based languages project on LLVM.org) to parse source code and turn it into an interim format. Then the LLVM code generation layer (back end) turns that interim format into final machine code.
Just a guess - you declare variable (probably const char*
) inside 1 of your switch-case statements - you should wrap that case in {} to fix that.
// error
case 1:
const char* a = ...
break;
// OK
case 1:{
const char* a = ...
}
break;
You probably declare a variable inside a case without wrapping it all in a brace:
case foo:
const char* selectorName;
// ...
break;
Should be:
case foo: {
const char* selectorName;
// ...
break;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With