Sign in to follow this  
  • entries
    88
  • comments
    117
  • views
    61969

Return value corruption

Sign in to follow this  
dcosborn

163 views

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:

#include 
#include

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  


0 Comments


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