XCode 4.2 clang 段错误

发布于 2024-12-10 06:18:25 字数 1074 浏览 0 评论 0原文

刚刚升级到 Lion 和 xcode 4.2。现在,当我重新编译程序时,出现以下错误:

  1. /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1806:35: current parser token ';'
  2. /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1762:1:解析Objective-C方法'updateWithTouchLocationMoved:withEvent:view:'
  3. /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1762:1: 在复合语句 ('{}') 中
  4. /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1771:2:在复合语句('{}')中
  5. /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1789:3:在复合语句 ('{}')
  6. /Users/XXX/Code/iPhone /XXX/Code/Scenes/GameScene.mm:1796:4:在复合语句('{}')中
  7. /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1799:5:在复合语句('{}')中
    clang:错误:无法执行命令:分段错误:11
    clang: error: clang frontend command failed due to signal 2 (使用 -v 查看调用)

这些行号周围没有任何奇怪的事情发生。没有复合语句,只有简单的 if (a == b) 类型的东西。有些错误行号甚至不在语句上,只是空行或 { 大括号。我怀疑行号不准确。我现在已经快死在水里了。代码在 4.1 下编译良好。

有什么建议吗?

Just upgraded to Lion and xcode 4.2. Now when I recompile my program I getting these errors:

  1. /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1806:35: current parser token ';'
  2. /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1762:1: parsing Objective-C method 'updateWithTouchLocationMoved:withEvent:view:'
  3. /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1762:1: in compound statement ('{}')
  4. /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1771:2: in compound statement ('{}')
  5. /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1789:3: in compound statement ('{}')
  6. /Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1796:4: in compound statement ('{}')
  7. /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)

There is nothing odd going on around those line numbers. No compound statements, just simple if (a == b) type stuff. Some of the error line numbers aren't even on statements, just blank lines or a { brace. I suspect that the line numbers are not accurate. I'm kind of dead in the water now. Code compiled fine under 4.1.

Any advice?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寄离 2024-12-17 06:18:25

我阻止了编译器崩溃。在注释掉一行又一行的代码以查看实际发生的情况后,我到达了这一行:

shape.shapeType |= kTypeBreakable;

Doing...

shape.shapeType = shape.shapeType | kTypeBreakable;

...编译正常。也是如此...

shape.shapeType |= 0x00000200;

kTypeBreakable 是一个设置为 0x00000200 的枚举

shapeType 只是一个带有 getter/setting 的 obj-c 对象变量。

非常非常奇怪的编译器错误。

I stopped the compiler from crashing. After commenting out line after line of code to see where this was actually happening I arrived at this line:

shape.shapeType |= kTypeBreakable;

Doing...

shape.shapeType = shape.shapeType | kTypeBreakable;

...compiles fine. So does...

shape.shapeType |= 0x00000200;

kTypeBreakable is an enum that is set to 0x00000200

shapeType is just a obj-c object variable with a getter/setting.

Very very odd compiler bug.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文