Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Jun 2002 08:09:48 +0200
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        ports <freebsd-ports@freebsd.org>
Cc:        obrien@freebsd.org
Subject:   Re: mail/mutt-devel port & "ANSI C does not support long long" in /usr/include/stdlib.h
Message-ID:  <20020630060948.GA76168@falcon.midgard.homeip.net>
In-Reply-To: <20020630051957.GA58539@falcon.midgard.homeip.net>
References:  <20020630020344.GA23683@moo.holy.cow> <20020630051957.GA58539@falcon.midgard.homeip.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jun 30, 2002 at 07:19:57AM +0200, Erik Trulsson wrote:
> On Sat, Jun 29, 2002 at 10:03:44PM -0400, parv wrote:
> > freebsd-stable/i386 version is 2002.06.27.13.03.33 and stdlib.h is
> > 1.16.2.3, 2001.12.27.20.35.34.
> > 
> > below is the warning that i currently get while compiling
> > mail/mutt-devel for every cc command (which did not happen for
> > previous version(s) of freebsd {4.6-rc to 4.6-prerelease})...
> > 
> > 
> > cc -I/usr/local/include -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../intl  -I/include -I/usr/local/include/sasl -I/usr/local/include -I../
> > intl  -Wall -pedantic -O -pipe -march=pentiumpro -c auth.c
> > In file included from ../mutt.h:22,
> >                  from auth.c:23:
> > /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'
> > cc -I/usr/local/include -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../intl  -I/include -I/usr/local/include/sasl -I/usr/local/include -I../
> > intl  -Wall -pedantic -O -pipe -march=pentiumpro -c auth_login.c
> > In file included from ../mutt.h:22,
> >                  from auth_login.c:21:
> > /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'
> > ...
> > 
> > 
> > ...how serious is it?  is the problem related to either freebsd,
> > mutt, or both?
> 
> It is not serious and nothing to worry about.  It is just gcc which
> tries to be helpful and doesn't quite succeed.
> 
> 'long long' is supported by gcc and it is in the latest C standard so
> everything is actually OK.
> The problem is just that the version of gcc in -stable does not know
> about the latest version of the C standard and complains because 'long
> long' was not in the previous standard.
> 
> gcc was recently updated in -stable (from 2.95.3 to 2.95.4).  I guess
> one of the changes there is responsible for this warning starting to
> appear.
> 

[Following up to myself after having done a closer investigation]

By looking at the source it seems that gcc is not supposed to be
emitting this warning for system headers.  Apparently
/usr/include/stdlib.h is not treated as a system include file.

I believe that the following change to contrib/gcc/cccp.c is
responsible:

@@ -4757,12 +4757,14 @@
 is_system_include (filename)
     register char *filename;
 {
+#ifndef FREEBSD_NATIVE
   struct file_name_list *searchptr;
 
   for (searchptr = first_system_include; searchptr;
        searchptr = searchptr->next)
     if (! strncmp (searchptr->fname, filename, strlen (searchptr->fname)))
       return searchptr->c_system_include_path + 1;
+#endif
   return 0;
 }


This seems to make all header files treated as non-system includes.
What was the reason for this change?  

(I assume there is a good reason, I am just curious as to what that
reason might be, as it is a bit annoying to get such warnings for every
program compiled with -pedantic, even if the program itself is
perfectly fine.)



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

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




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