Description of problem: I'm compiling libdgiplus from the mono svn repository. One of the source files fails to compile. If I change font.c (line 283) to read if strcmp((unsigned char*)string,(unsigned char*) str)... and attempt to recompile, the warnings about the signed in strcmp are removed, but remain for strlen (which is not referenced in that line at all, which makes me suspect a problem with gcc rather than the source) Version-Release number of selected component (if applicable): gcc-4.0.0.0-0.33 How reproducible: Always Steps to Reproduce: 1. Download from svn libgdiplus 2. ./autogen.sh; make 3. Actual results: See attachment, it fails to compile Expected results: Compilation should work Additional info:
Created attachment 112017 [details] Source file causing the problems
Created attachment 112018 [details] Error report from compilation Throw back from the source code compilation shows that there is a signed problem in strcmp and strlen. The source code maintains that the arguments being passed in are unsigned char* (the variables are of that type).
The problem is just that the testcase you provided violates ISO C standards, nothing else. Older GCC versions were warning (resp. erroring out) on this just with -pedantic, now this warning is on by default, see: http://gcc.gnu.org/ml/gcc-patches/2004-07/msg01284.html It can be turned off with -Wno-pointer-sign, but it is better to actually fix the code. The reason why you get warnings about strlen etc. is that optimized strcmp in <bits/string2.h> is implemented as a #define that uses strlen etc. internally. If you compile with -O0 or -D__NO_STRING_INLINES, you get the warning just about strcmp.