Pindel fix to allow compilation on Debian 9.0

Pindel fix to allow compilation on Debian 9.0


I recently had some trouble compiling Pindel in a recent Debian release: the gcc compiler aborts after some errors related to the (in)existence of the overloaded function abs(unsigned int).

Though googling the issue quickly finds an answer in the form of a patch, the magnitude of this bug that has not been fixed until 2017 is not clear to me (Pindel was initially released in 2009).

The behavior of the compiler in previous versions was probably issuing a warning and going ahead with the compilation. In this case this would’ve been a potentially dangerous bug, since it’s used several times in the form of if(abs(posA - posB) < 10), where posA and posB are unsigned int. You may know that in C++, the container storing the result of such operation will also be unsigned int, leading to overflow (i.e., producing an enormous number) if the result of the operation is negative. In the best case the compiler would silently convert the unsigned int variables into int.

My question is, did anyone have the chance to compare the results pre- and post-patch?

PS: Hopefully this will reach the developers. Sorry if here’s not the best place to ask, but the repository in github is archived and there’s no way to comment or add issues there.



Read more here: Source link