Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 19777 - gcc does not compile NCBI toolkit
gcc does not compile NCBI toolkit
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2000-10-25 12:23 EDT by Kristian
Modified: 2007-04-18 12:29 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-10-25 12:23:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Kristian 2000-10-25 12:23:08 EDT
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 ...
Comment 1 Jakub Jelinek 2000-10-25 12:28:23 EDT
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).

Note You need to log in before you can comment on or make changes to this bug.