Bug 19777 - gcc does not compile NCBI toolkit
Summary: gcc does not compile NCBI toolkit
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
(Show other bugs)
Version: 7.0
Hardware: i386 Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL: ftp://ftp.ncbi.nlm.nih.gov/toolbox/nc...
Depends On:
TreeView+ depends on / blocked
Reported: 2000-10-25 16:23 UTC by Kristian
Modified: 2007-04-18 16:29 UTC (History)
0 users

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

Attachments (Terms of Use)

Description Kristian 2000-10-25 16:23:08 UTC
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 16:28:23 UTC
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.