From owner-freebsd-current@FreeBSD.ORG Sun Jul 13 06:24:53 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 1ACA737B401 for ; Sun, 13 Jul 2003 06:24:53 -0700 (PDT) Received: from smtpout.mac.com (A17-250-248-89.apple.com [17.250.248.89]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E78743FAF for ; Sun, 13 Jul 2003 06:24:52 -0700 (PDT) (envelope-from leimy2k@mac.com) Received: from mac.com (smtpin07-en2 [10.13.10.152]) by smtpout.mac.com (Xserve/MantshX 2.0) with ESMTP id h6DDOn17016685; Sun, 13 Jul 2003 06:24:49 -0700 (PDT) Received: from mac.com (adsl-78-178-166.jan.bellsouth.net [216.78.178.166]) (authenticated bits=0) by mac.com (Xserve/8.12.9/MantshX 2.0) with ESMTP id h6DDNtIK007942; Sun, 13 Jul 2003 06:24:13 -0700 (PDT) In-Reply-To: <20030713000559.28c18be6.kabaev@mail.ru> References: <20030712155333.GA79322@crodrigues.org> <20030713031312.GA89014@crodrigues.org> <20030713000559.28c18be6.kabaev@mail.ru> Mime-Version: 1.0 (Apple Message framework v578) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <401FAE5E-B535-11D7-BE3B-0003937E39E0@mac.com> Content-Transfer-Encoding: 7bit From: David Leimbach Date: Sun, 13 Jul 2003 08:23:54 -0500 To: Alexander Kabaev X-Mailer: Apple Mail (2.578) cc: Craig Rodrigues 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 13:24:53 -0000 On Saturday, July 12, 2003, at 11:05PM, 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. > This is a good policy in general, however, one could easily argue that what is trying to be determined with signedness and such being less-than-compared to 0 isn't really a big deal and possibly the only way to implement this numeric_limits::digits thing without any type introspection which C++ currently lacks. The following would work for example in a template function: template void foo(T const & f) { if (numeric_limits::digits % 2) //type is signed else //type is unsigned } However to implement "digits" we have that nasty macro that makes the comparison which is meaningless for unsigned types of "< 0". This is probably a perfect example of where the C++ standards committee folks should be queried about the best way to implement numeric_limits::digits. Some of them have had no trouble pointing out that C99's tgmath.h header cannot be implemented in pure standard C99. This may also be true of numeric_limits::digits. I am going to the newsgroups... My old college advisor is/was a moderator on comp.lang.c++.moderated and he may "just know" the answer :). >> >> 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. I'd rather we fix the problem in gcc but this extra verbosity when there is nothing wrong with user code also seems incorrect. I think the gcc developers should have a separate command line option for internal headers don't you? > > -- > Alexander Kabaev