2010 Fixes / Stupid Bugs

Here we see a log of important mistakes I've had to deal with or made myself.

System: Gentoo Linux

PROBLEM: apvlv-0.0.9 + poppler-glib-0.10.7 gives a segmentation fault.
FIX: upgrade poppler-glib (and poppler) (to version 0.12.1 in my case).

PROBLEM: Unsigned ints do not degrade into signed ones appropriately in C/C++ and probably others.
unsigned a = 2;
assert (-1*a == -2);  // fail
assert (1-a == -1);  // fail


PROBLEM: In C++, abs(double) is in the std namespace, but abs(int) is not. g++ will not warn about the following code and convert the double to an int.
#include <cmath>
std::cout << abs(3.5) << std::endl;  // 3


2010.01.14 - last edit >> Sat, 27 Mar 2010 00:03:07 -0400