From: Brian P. <bri...@tu...> - 2006-08-24 23:59:29
|
Daniel E. Shipton wrote: > 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); I've added the casts in CVS. Thanks! -Brian |