Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 May 1997 14:28:18 -0400 (EDT)
From:      "Kenneth R. Westerback" <krw@tcn.net>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   misc/3575: Eliminate spurious warning in /usr/src/lib/libc/stdlib/strtoq.c
Message-ID:  <199705101828.OAA00445@Pkrw.tcn.net>
Resent-Message-ID: <199705101830.LAA15362@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         3575
>Category:       misc
>Synopsis:       compilation of strtoq.c produces unnecessary warning
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 10 11:30:01 PDT 1997
>Last-Modified:
>Originator:     Kenneth R. Westerback
>Organization:
>Release:        FreeBSD 2.2-STABLE i386
>Environment:

	FreeBSD 2-2-STABLE make world'ed through src-2.2.0217

>Description:

	During a make world the compilation of 
	
	/usr/src/lib/libc/stdlib/strtoq.c

	produces a warning message


	/usr/src/lib/libc/stdlib/strtoq.c:108: warning: integer overflow in expression

>How-To-Repeat:

	make world or just compile strtoq.c

>Fix:
	
	Apply following one line patch:

--- /usr/src/lib/libc/stdlib/strtoq.c	Sat May 10 11:55:38 1997
+++ strtoq.c	Sat May 10 14:10:02 1997
@@ -105,7 +105,7 @@
 	 * overflow.
 	 */
 	qbase = (unsigned)base;
-	cutoff = neg ? -(u_quad_t)QUAD_MIN : QUAD_MAX;
+	cutoff = (u_quad_t)(neg ? QUAD_MIN : QUAD_MAX);
 	cutlim = cutoff % qbase;
 	cutoff /= qbase;
 	for (acc = 0, any = 0;; c = *s++) {

>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705101828.OAA00445>