Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode LLVM 3.1 and GCC_OPTIMIZATION_LEVEL

Tags:

xcode

ios

llvm

I have an Xcode 4.3.2 iOS 5.1 project that compiles and runs fine when my build configuration uses a GCC_OPTIMIZATION_LEVEL of None [-O0], but fails with a EXC_BAD_ACCESS error when using any other optimization level. My project has GCC_VERSION set to Apple LLVM 3.1 (the default). Does this indicate a problem with my code?

like image 251
Erik Avatar asked Aug 08 '26 00:08

Erik


1 Answers

Most often it indicates problem with your code. Like:

  • accessing already deallocated memory
  • reading or writing memory out of bounds of allocated array
  • using non initialized variables or class members
  • and many many others...

In rare cases it happens that such kind of crash turns out to be a compiler bug. But that is rare. More often that is problem with your code.

Try to pinpoint code that crashes and try to see how variables are used nearby that code. Check if everything is used/allocated/initialized/freed correctly there.

like image 116
Mārtiņš Možeiko Avatar answered Aug 10 '26 15:08

Mārtiņš Možeiko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!