Subject: lib/1221: Compiler warning from strtoq.c
To: None <gnats-admin@sun-lamp.pc.cs.cmu.edu>
From: None <uhenric@mcl.ucsb.edu>
List: netbsd-bugs
Date: 07/12/1995 22:50:03
>Number:         1221
>Category:       lib
>Synopsis:       gcc2.7.0 warns of integer overflow in strtoq.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 12 22:50:01 1995
>Originator:     Henric Jungheim
>Organization:
	
>Release:        July 12th <NetBSD-current source date>
>Environment:
	
System: NetBSD blurg.blurg.ucsb.edu 1.0A NetBSD 1.0A (HENRIC) #26: Wed Jul 12 02:30:56 PDT 1995 henric@blurg.blurg.ucsb.edu:/usr/src/sys/arch/amiga/compile/HENRIC amiga
A4000/040 running gcc2.4.5 compiled kernel and gcc2.7.0 for the rest

>Description:
	
gcc2.7.0 give the following warning when compiling strtoq.c:
cc -O -DNLS -DYP -DLIBC_SCCS -DSYSLIBC_SCCS -I/usr/src/lib/libc/include -D__DBIN
TERFACE_PRIVATE -DPOSIX_MISTAKE -DFLOATING_POINT  -c -p /usr/src/lib/libc/stdlib
/strtoq.c -o strtoq.po
/usr/src/lib/libc/stdlib/strtoq.c: In function `strtoq':
/usr/src/lib/libc/stdlib/strtoq.c:108: warning: integer overflow in expression

The line in question reads:
cutoff = neg ? -(u_quad_t)QUAD_MIN : QUAD_MAX;


>How-To-Repeat:
>Fix:
	
Removing the minus sign might help... it has no effect anyway (except for
the warning message).
>Audit-Trail:
>Unformatted: