Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Aug 2002 16:53:09 +0200
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        Eugene Grosbein <eugen@grosbein.pp.ru>
Cc:        stable@freebsd.org
Subject:   Re: /usr/include/stdlib.h:110: warning: ANSI C does not support `long long'
Message-ID:  <20020822145308.GA11197@falcon.midgard.homeip.net>
In-Reply-To: <20020822223657.A364@grosbein.pp.ru>
References:  <20020822223657.A364@grosbein.pp.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Aug 22, 2002 at 10:36:57PM +0800, Eugene Grosbein wrote:
> Hi!
> 
> I used to maintain some projects written in C at the age of FreeBSD 3.x.
> Programs used to build silently, without any warning on FreeBSD 3.x and
> early 4.x releases using 'gcc -ansi -pedantic -Wall'.
> 
> Now I get lots of warning in system includes. For example, in <stdlib.h>:
> 
> #include <stdio.h>
> #include <stdlib.h>
> 
> int main(void)
> {
>    calloc(10,1024*1024);
>    return 0;
> }
> 
> /* EOF */
> 
> # gcc -ansi -pedantic -Wall test.c
> In file included from test.c:4:
> /usr/include/stdlib.h:110: warning: ANSI C does not support `long long'
> /usr/include/stdlib.h:114: warning: ANSI C does not support `long long'
> 
> Why?

Because gcc no longer treats the header files in /usr/include
specially.  It used to suppress warnings from system headers but no
longer treats them as system headers. I don't know why this change was
made but it was made.

The warning is technically correct but you can ignore it.
(stdlib.h does use 'long long' and the original C standard did not have
long long, but since the new C standard does support long long it is not
much of a problem if it is used.)

To get rid of it either stop using -pedantic or add
-Wno-long-long to the invocation of gcc.

(Or you can do as I did, and patch gcc to no longer produce warnings
about 'long long' unless specifically requested by -Wlong-long . The
following patch will do this:


Index: contrib/gcc/c-decl.c
===================================================================
RCS file: /ncvs/src/contrib/gcc/c-decl.c,v
retrieving revision 1.1.1.4.2.3
diff -u -r1.1.1.4.2.3 c-decl.c
--- contrib/gcc/c-decl.c	21 Jun 2002 22:38:03 -0000	1.1.1.4.2.3
+++ contrib/gcc/c-decl.c	8 Jul 2002 06:58:21 -0000
@@ -491,7 +491,7 @@
 
 /* Nonzero means warn about usage of long long when `-pedantic'.  */
 
-int warn_long_long = 1;
+int warn_long_long = 0;
 
 /* Nonzero means message about use of implicit function declarations;
  1 means warning; 2 means error. */


 



-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




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