Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Return value corruption

Sign in to follow this  


I found a strange bug which was corrupting the return value of a couple of functions. The following code (alone) prints various numbers other than 0 when compiled with my second-hand MinGW GCC 4.1.1:


int F()

std::vector<char> buffer;
std::cout << std::endl;
return 0;
std::cout << std::endl;

int main()
std::cout << F() << std::endl;

If I remove any of the std::* lines, the problem disappears. So I have to assume this is a library issue, which shouldn't be unexpected because my copy of the standard library has been hacked up quite a bit.

Out of desperation I decided to try, once again, to build GCC under MinGW myself. Fortunately, I stumbled upon Scott Meyers' annotated version of Marcelo Slomp's howto. After clearing out my messy MinGW and installing a fresh copy of 3.4.5, I set about following the howto. And to my surprise, it worked! So I'll soon see whether this return value corruption was my own fault or a real issue.

Other than that, I also implemented row/column slicing (correct term?) into my matrix library using proxies and started on an arbitrary image format conversion function. I'm hoping to render something in the next few days, assuming these bugs go away.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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!