That is what I get when cross-compiling to ARM by gcc 4.6.3

arm-elf-gcc.exe -c -DCMS_NO_PTHREADS -std=c99 --pedantic -Wall -I ../include *.c
cmscgats.c: In function 'ParseFloatNumber':
cmscgats.c:643:5: warning: array subscript has type 'char' [-Wchar-subscripts]
cmsopt.c: In function 'OptimizeByComputingLinearization':
cmsopt.c:1035:26: warning: variable 'lIsLinear' set but not used [-Wunused-but-set-variable]
cmspcs.c: In function '_cmsLCMScolorSpace':
cmspcs.c:872:5: warning: overflow in implicit constant conversion [-Woverflow]

I tried also a modern compiler. gcc 6.3.1 complains on indentation because -Wmisleading-indentation, so turning it off:

arm-none-eabi-gcc.exe -c -DCMS_NO_PTHREADS -std=c99 --pedantic -Wall -Wno-misleading-indentation -I ../include *.c
cmsopt.c: In function 'OptimizeByComputingLinearization':
cmsopt.c:1035:26: warning: variable 'lIsLinear' set but not used [-Wunused-but-set-variable]
     cmsBool lIsSuitable, lIsLinear;
                          ^~~~~~~~~
cmspcs.c: In function '_cmsLCMScolorSpace':
cmspcs.c:872:22: warning: overflow in implicit constant conversion [-Woverflow]
     default:  return (cmsColorSpaceSignature) (-1);
                      ^

Again, please note that this is using C language, not C++.

Marti


On 7/26/2017 3:37 PM, Bob Friesenhahn wrote:
On Wed, 26 Jul 2017, Aaron Boxer wrote:

Thanks, Noel. Might be safer to do this on linux, where you can run make
check
to test. May I ask how I turn on -Wall on linux build for lcms ?

The normal way (quite well documented) is

  ./configure CFLAGS='-O2 -Wall' ...

I use these GCC options while building GraphicsMagick:

 ./configure 'CFLAGS=-O2 -g -ggdb -Wall -Winline -W -Wformat-security\
-Wpointer-arith -Wdisabled-optimization -Wdeclaration-after-statement'

There are of course many more warning options which can be enabled for people who have plenty of time on their hands. Even these options are not likely to include type conversion warnings.

Optimizing warnings for just one compiler is a bad idea. At least three completely different compilers should be used.

Bob


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to