Take this simple program:
#include <fstream>
int main()
{
std::ifstream in(".");
int x;
if (in)
in >> x;
}
on Redhat 6, gcc 4.4.7 this runs without error
on Ubuntu 14.04 LTS , gcc 4.8.2 this runs without error
on Redhat 7, gcc 4.8.2 I get:
terminate called after throwing an instance of 'std::ios_base::failure' what(): basic_filebuf::underflow error reading the file Aborted (cored dumped)
I think this is related to: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53984
However, then I don't understand why it works on Ubuntu.
Ideas?
The difference isn't the compiler, the difference is the C++ library. One of them has a buggy version of libstdc++, and the other has a working version of either libstdc++ or libc++ or another version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With