From: Daniel E. S. <dan...@gm...> - 2006-08-24 21:34:26
|
When using -Werror for 64bit builds(default for Linux) you come across a compile failure in printspu_init with gcc 4.1.1: Compiling printspu_init.c cc1: warnings being treated as errors printspu_init.c: In function 'printspu_signal_handler': printspu_init.c:47: warning: field precision should have type 'int', but argument 3 has type 'long int' gmake[3]: *** [../../built/printspu/Linux/printspu_init.o] Error 1 on this lines 47 and 84: fprintf(print_spu.fp, "%.*s", endOfVariable - nextVariable + 1, nextVariable); This warning (turned error) can be avoided by casting the result of the 3rd arg to an int. fprintf expects you to give it an int if specifying how much to print. endofVariable and nextVariable are both char* which makes the whole expression return a long int. fprintf(print_spu.fp, "%.*s", (int)(endOfVariable - nextVariable + 1), nextVariable); By changing config/Linux.mk and changing -Werror to -Wall will also let this build. When it rains, it pours ;) -Dan -- Daniel E. Shipton Software Engineer, Infiscape Corp. |