Xcode 4.2 clang seg fault

Just upgraded to Lion and xcode 4.2. Now, when I recompile my program, I get the following errors:

  • /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1806:35: current parser token ';'
  • /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1762:1: parsing Objective-C method 'updateWithTouchLocationMoved:withEvent:view:'
  • /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1762:1: in compound statement ('{}')
  • /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1771:2: in compound statement ('{}')
  • /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1789:3: in compound statement ('{}')
  • /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1796:4: in compound statement ('{}')
  • /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1799:5: in compound statement ('{}')
    clang: error: unable to execute command: Segmentation fault: 11
    clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)

Nothing strange happens to these line numbers. There are no compound statements, just if (a == b) enter the material. Some error line numbers do not even apply to statements, just empty lines or {brackets. I suspect line numbers are not accurate. Now I am already dead in the water. The code is compiled under 4.1.

Any tips?

+4
source share
1 answer

I stopped the compiler from crashing. After commenting out the line after the line of code to see where this happens, I came to this line:

 shape.shapeType |= kTypeBreakable; 

Keeping ...

 shape.shapeType = shape.shapeType | kTypeBreakable; 

... compiles fine. So does ...

 shape.shapeType |= 0x00000200; 

kTypeBreakable is an enumeration that is set to 0x00000200

shapeType is just an obj-c object variable with the getter / parameter.

A very unusual compiler error.

+2
source

All Articles