g++ -c -ggdb -O0 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fPIC -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/mysql -I/usr/include/python2.7 -I/usr/include/python2.7 -D_GNU_SOURCE -DBINDEST='"/usr/bin"' -DTARGET='"epgd"' -DLOG_PREFIX='""' -DPLGDIR='"/usr/lib64/epgd"' -DUSEUUID -DUSEMD5 -DUSELIBXML -DUSELIBARCHIVE -DUSEJSON -DUSEGUNZIP -I/usr/include/libxml2 -I/usr/include/libxml2 -DGIT_REV='""' -o series.o series.c series.c: In member function 'int cEpgd::evaluateEpisodes()': series.c:90:99: error: call of overloaded 'abs(size_t)' is ambiguous if (::abs(strlen(evtCompShortText) - strlen(episodeDb->getStrValue("COMPPARTNAME"))) >= dMin) ^ In file included from /usr/include/c++/6.0.0/cstdlib:75:0, from /usr/include/c++/6.0.0/stdlib.h:36, from /usr/include/libxml2/libxml/SAX.h:16, from /usr/include/libxml2/libxml/globals.h:20, from /usr/include/libxml2/libxml/xmlIO.h:117, from /usr/include/libxml2/libxml/parser.h:811, from /usr/include/libxslt/transform.h:15, from epgd.h:11, from series.c:8: /usr/include/stdlib.h:774:12: note: candidate: int abs(int) extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; ^~~ the program compiles fine with gcc-5.3.1
This is invalid; calling abs() on an unsigned value does not make sense. Cf. http://cplusplus.github.io/LWG/lwg-active.html#2192
(In reply to mgansser@alice.de from comment #0) > series.c:90:99: error: call of overloaded 'abs(size_t)' is ambiguous > if (::abs(strlen(evtCompShortText) - > strlen(episodeDb->getStrValue("COMPPARTNAME"))) >= dMin) > This doesn't do what the author of that code thinks it does. If the second string is longer than the first then the difference between them is not a negative number, it's a huge unsigned value. Calling abs(int) on a huge unsigned value will overflow and is undefined behaviour. This is exactly why calling abs() here should be an error: the code has undefined behaviour and should be fixed.
many thanks for supporting me, problem was solved.