Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


From line 149 to line 146 without goto!

This topic is 5363 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I wrote this code:
146: VirtualPtr  p1;
147: VirtualPtr  p2;
149: p1 = v.getMemory  ();
150: p2 = v.getMemory  ();
When I step-debug (step) it, it jumps from the line 149 back to the 146. Anyone knows what is it supposed to mean? It''s compiled using g++ 3.2.2 and debugged using gdb. Oxyd --- - Unreadable code is code written on a piece of paper, but not the one, in which the programmer is using a space in the place you don''t. - Real programmers aren''t afraid of goto

Share this post

Link to post
Share on other sites
I don''t know for sure how GCC optimizes, but in this case I believe the compiler realized your code was creating a var and then initializing it later without using it anywhere before initialization.

Then it just combined the declaration with initialization, realizing there would be no repercussions.

daveandrews.org - a Christian Programmer''s Weblog | Dusty Engine - a task engine using Irrlicht | Computer Guys Run the World
How to be a Programmer

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!