• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: "jump to label crosses initialization of..."
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "jump to label crosses initialization of..."


  • Subject: Re: "jump to label crosses initialization of..."
  • From: Lawrence Gold <email@hidden>
  • Date: Wed, 15 Jun 2005 17:43:58 -0600

On Jun 15, 2005, at 5:54 PM, Tim Conkling wrote:

I'm moving a C++ (CFM) project over from CodeWarrior 9.5 to Xcode 2.1. gcc is complaining about the following code:

    #ifdef LUA_DEBUG

    if(0 != lua_gettop(L))
        goto HandleErr;

    #endif

    ...
    const DoubleRect& pos = curSprite->getPos();
    ...

    #ifdef LUA_DEBUG

    HandleErr:
    lua_stringerror(L, "GetPosition expects 0 arguments");

    return 0;

    #endif

The error messages (there are three) are:

LuaSpriteInterface.cpp:1205: error: jump to label 'HandleErr'
LuaSpriteInterface.cpp:1186: error: from here
LuaSpriteInterface.cpp:1194: error: crosses initialization of 'const DoubleRect& pos'



Am I doing something non-standard here? How can I fix it? I would like to continue using goto: as this problem occurs in many places in my code.

I'm not sure what the C++ standard says about this, but GCC is definitely pickier than CodeWarrior about such things. CodeWarrior seems to only complain when something other than a simple built-in type is being instantiated.


A simple fix is to enclose the block that uses 'pos' between { }.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >"jump to label crosses initialization of..." (From: Tim Conkling <email@hidden>)

  • Prev by Date: Multiple projects - can they share the same project folder?
  • Next by Date: Split windows
  • Previous by thread: "jump to label crosses initialization of..."
  • Next by thread: Re: "jump to label crosses initialization of..."
  • Index(es):
    • Date
    • Thread