there's a probelm compiling the NCBI toolkit (ftp://ftp.ncbi.nlm.nih.gov/toolbox/ncbi_tools/ncbi.tar.gz) with the new gcc. Apparently, the compilation stops here: gcc -pipe -g3 -c -I../include -I/usr/X11R6/include -L/usr/X11R6/lib -DWIN_MOTIF tsprintf.c tsprintf.c: In function `vsprintf_count_args': tsprintf.c:399: `short int' is promoted to `int' when passed through `...' tsprintf.c:399: (so you should pass `int' not `short int' to `va_arg') tsprintf.c:401: `short unsigned int' is promoted to `int' when passed through `...' ... and the piece of code looks like this: 395: if (qualifier == 'l') 396: num = va_arg(args, unsigned long); 397: else if (qualifier == 'h') 398: if (flags & SIGNED) 399: num = va_arg(args, short); 400: else 401: num = va_arg(args, unsigned short); 402: else if (flags & SIGNED) 403: num = va_arg(args, int); 404: else 405: num = va_arg(args, unsigned int); probbably the code is broken, but the fact is that it compiles without any problems with egcs 1.1.2 ...
Yes, the code is broken and should be fixed. 398: if (flags & SIGNED) 399: num = (short)va_arg(args, int); 400: else 401: num = (unsigned short)va_arg(args, unsigned int); should do the trick. It was decided it is better to error on such bogus code than to leave it to undefined behaviour (the error message is pretty self-explanatory I think).