From dim@tensor.xs4all.nl  Tue Jul  9 05:50:23 2002
Return-Path: <dim@tensor.xs4all.nl>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 7805F37B40A
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  9 Jul 2002 05:50:17 -0700 (PDT)
Received: from tensor.xs4all.nl (tensor.xs4all.nl [213.84.94.69])
	by mx1.FreeBSD.org (Postfix) with ESMTP id D1C2B43E3B
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  9 Jul 2002 05:50:16 -0700 (PDT)
	(envelope-from dim@tensor.xs4all.nl)
Received: by tensor.xs4all.nl (Postfix, from userid 1000)
	id 9D4085766; Tue,  9 Jul 2002 14:50:13 +0200 (CEST)
Message-Id: <20020709125013.9D4085766@tensor.xs4all.nl>
Date: Tue,  9 Jul 2002 14:50:13 +0200 (CEST)
From: Dimitry Andric <dim@xs4all.nl>
Reply-To: Dimitry Andric <dim@xs4all.nl>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: stdlib.h gives needless warnings with -ansi
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         40378
>Category:       kern
>Synopsis:       stdlib.h gives needless warnings with -ansi
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-standards
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 09 06:00:13 PDT 2002
>Closed-Date:    Mon Aug 15 13:41:20 GMT 2005
>Last-Modified:  Mon Aug 15 13:41:20 GMT 2005
>Originator:     Dimitry Andric <dim@xs4all.nl>
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
n/a
>Environment:
System: FreeBSD tensor.xs4all.nl 4.6-STABLE FreeBSD 4.6-STABLE #0: Sat Jul 6 19:59:01 CEST 2002 root@tensor.xs4all.nl:/usr/obj/usr/src/sys/TENSOR i386
>Description:
Since my latest cvsup (from 4.6-RC to 4.6-STABLE), lots of programs
that are built with the gcc `-ansi' option have started complaining
about stdlib.h, like this:

In file included from ../../../../../../extras/Mesa/src/glheader.h:60,
                 from ../../../../../../extras/Mesa/src/types.h:32,
                 from mgafastpath.c:31:
/usr/include/stdlib.h:108: warning: ANSI C does not support `long long'
/usr/include/stdlib.h:112: warning: ANSI C does not support `long long' 

It seems that there has been some fiddling with __LONG_LONG_SUPPORTED
and related defines, and these two functions have been missed, maybe?
>How-To-Repeat:
Compile any program that uses stdlib.h with -ansi, for example most of
the XFree86-4 ports.
>Fix:
Here's a patch that removes these warnings. I hope it doesn't break
anything else, but ANSI C source shouldn't use long long anyway. :)

--- stdlib.h.orig	Thu Jan  3 00:57:03 2002
+++ stdlib.h	Tue Jul  9 14:39:10 2002
@@ -104,12 +104,14 @@
 void	 srand __P((unsigned));
 double	 strtod __P((const char *, char **));
 long	 strtol __P((const char *, char **, int));
-long long	 
-	 strtoll __P((const char *, char **, int));
 unsigned long
 	 strtoul __P((const char *, char **, int));
+#ifndef __STRICT_ANSI__
+long long
+	 strtoll __P((const char *, char **, int));
 unsigned long long
 	 strtoull __P((const char *, char **, int));
+#endif
 int	 system __P((const char *));
 
 int	 mblen __P((const char *, size_t));
>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: Dimitry Andric <dim@xs4all.nl>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: misc/40378: stdlib.h gives needless warnings with -ansi
Date: Wed, 10 Jul 2002 07:24:08 +1000 (EST)

 On Tue, 9 Jul 2002, Dimitry Andric wrote:
 
 > >Description:
 > Since my latest cvsup (from 4.6-RC to 4.6-STABLE), lots of programs
 > that are built with the gcc `-ansi' option have started complaining
 > about stdlib.h, like this:
 >
 > In file included from ../../../../../../extras/Mesa/src/glheader.h:60,
 >                  from ../../../../../../extras/Mesa/src/types.h:32,
 >                  from mgafastpath.c:31:
 > /usr/include/stdlib.h:108: warning: ANSI C does not support `long long'
 > /usr/include/stdlib.h:112: warning: ANSI C does not support `long long'
 >
 > It seems that there has been some fiddling with __LONG_LONG_SUPPORTED
 > and related defines, and these two functions have been missed, maybe?
 
 RELENG_4 was broken here between 4.2-RELEASE and 4.3-RELEASE.  The
 "fiddling" to fix the problem is only in -current.
 
 Bruce
 
Responsible-Changed-From-To: freebsd-bugs->freebsd-standards 
Responsible-Changed-By: johan 
Responsible-Changed-When: Fri Oct 25 04:52:03 PDT 2002 
Responsible-Changed-Why:  
Hopefully the people here knows if this is  
the correct behavior in 4-Stable? 

Should gcc -ansi warn about long long? 
Should we use long long in our headers? 

Please close this PR if everything is as it should. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=40378 
State-Changed-From-To: open->closed 
State-Changed-By: stefanf 
State-Changed-When: Mon Aug 15 13:40:34 GMT 2005 
State-Changed-Why:  
Fixed in stdlib.h's revision 1.16.2.5. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=40378 
>Unformatted:
