From owner-freebsd-current@FreeBSD.ORG Sat Jul 12 21:42:30 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A462F37B404 for ; Sat, 12 Jul 2003 21:42:30 -0700 (PDT) Received: from h00609772adf0.ne.client2.attbi.com (h00609772adf0.ne.client2.attbi.com [66.31.45.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id 75F9B43F75 for ; Sat, 12 Jul 2003 21:42:24 -0700 (PDT) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com (localhost.ne.attbi.com [127.0.0.1])h6D4hWrx089821; Sun, 13 Jul 2003 00:43:32 -0400 (EDT) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)h6D4hWf5089820; Sun, 13 Jul 2003 00:43:32 -0400 (EDT) Date: Sun, 13 Jul 2003 00:43:31 -0400 From: Craig Rodrigues To: Alexander Kabaev Message-ID: <20030713044331.GA89785@crodrigues.org> References: <20030712155333.GA79322@crodrigues.org> <20030713031312.GA89014@crodrigues.org> <20030713000559.28c18be6.kabaev@mail.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030713000559.28c18be6.kabaev@mail.ru> User-Agent: Mutt/1.4i cc: freebsd-current@freebsd.org Subject: Re: GCC 3.3.1, new warnings with X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jul 2003 04:42:30 -0000 On Sun, Jul 13, 2003 at 12:05:59AM -0400, Alexander Kabaev wrote: > On Sat, 12 Jul 2003 23:13:12 -0400 > Craig Rodrigues wrote: > > > I am guessing that the C preprocessor does not think that it is > > in a system header, and thus prints out the warning. > > We specifically disable automatic warning suppression for system > headers, because we _want_ to know about them. Your Linux distribution > apparently does not care. How do you disable/enable warning suppression for system headers? I am not familiar enough with how GCC works in this area. > > Any GCC/FreeBSD expert care to comment? ;) > > > Short of fixing offending files in FSF libstdc++ or turning warning > suppression back on for standard C++ include files selectively, I have > no suggestion. Hmm, I'm not sure what to recommend here either. I'd like to see this fixed somewhere, because this increases the warning output for some large C++ projects that I work with (I like to see warnings also). The warnings seemed to be caused by this code in /usr/include/c++/3.3/limits: ========================================================================= 630 static const int digits = __glibcpp_digits (unsigned int); 631 static const int digits10 = __glibcpp_digits10 (unsigned int); ========================================================================= The macros are defined in the same file here: ============================================================================ 134 #define __glibcpp_signed(T) ((T)(-1) < 0) 142 #define __glibcpp_digits(T) \ 143 (sizeof(T) * __CHAR_BIT__ - __glibcpp_signed (T)) ============================================================================ The expanded macros look like: static const int digits = (sizeof(unsigned int) * 8 - ((unsigned int)(-1) < 0)); static const int digits10 = ((sizeof(unsigned int) * 8 - ((unsigned int)(-1) < 0)) * 643 / 2136); I don't really know how to fix this. Maybe introduce a new macro? #define __glibcpp_unsigned_digits(T) \ (sizeof(T) * __CHAR_BIT__ and then use that macro only for unsigned quantities? Thanks. -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org