Jump to content
  • Advertisement

Archived

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

Oxyd

From line 149 to line 146 without goto!

This topic is 5193 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;
148: 
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
Advertisement
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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!