From owner-freebsd-stable Thu Aug 22 7:53:23 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3944137B400 for ; Thu, 22 Aug 2002 07:53:18 -0700 (PDT) Received: from maile.telia.com (maile.telia.com [194.22.190.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7DF1043E3B for ; Thu, 22 Aug 2002 07:53:16 -0700 (PDT) (envelope-from erikt@midgard.homeip.net) Received: from d1o913.telia.com (d1o913.telia.com [195.252.44.241]) by maile.telia.com (8.12.5/8.12.5) with ESMTP id g7MErE4Q027324 for ; Thu, 22 Aug 2002 16:53:15 +0200 (CEST) X-Original-Recipient: Received: from falcon.midgard.homeip.net (h62n2fls20o913.telia.com [212.181.163.62]) by d1o913.telia.com (8.8.8/8.8.8) with SMTP id QAA21131 for ; Thu, 22 Aug 2002 16:53:10 +0200 (CEST) Received: (qmail 11247 invoked by uid 1001); 22 Aug 2002 14:53:09 -0000 Date: Thu, 22 Aug 2002 16:53:09 +0200 From: Erik Trulsson To: Eugene Grosbein 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> Mail-Followup-To: Eugene Grosbein , stable@freebsd.org References: <20020822223657.A364@grosbein.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020822223657.A364@grosbein.pp.ru> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 : > > #include > #include > > 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. */ -- Erik Trulsson ertr1013@student.uu.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message