From owner-freebsd-current@FreeBSD.ORG Tue Jul 15 04:02:40 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 6153037B401 for ; Tue, 15 Jul 2003 04:02:40 -0700 (PDT) Received: from stork.mail.pas.earthlink.net (stork.mail.pas.earthlink.net [207.217.120.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id BCBBA43FA3 for ; Tue, 15 Jul 2003 04:02:39 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-38lc12t.dialup.mindspring.com ([209.86.4.93] helo=mindspring.com) by stork.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19cNZq-00053W-00; Tue, 15 Jul 2003 04:02:35 -0700 Message-ID: <3F13DE92.CE30D244@mindspring.com> Date: Tue, 15 Jul 2003 03:59:30 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: David Leimbach References: <5574086.1058214806759.JavaMail.leimy2k@mac.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4da8ab1577e79cfee8705a23edc17d66d666fa475841a1c7a350badd9bab72f9c350badd9bab72f9c cc: Craig Rodrigues cc: Alexander Kabaev 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: Tue, 15 Jul 2003 11:02:40 -0000 David Leimbach wrote: > >Gcc needs a #pragma to disable specific warnings as a one-shot. > > > >This was discussed in detail on the GCC mailing list. > > True... but I don't think I was talking about a one-shot disabling > of the message. > > I was thinking more about how a compliant C++ compiler can determine > the signedness of a datatype without type introspection or type > metadata available at compile time. [which seems to be what > numeric_limits is all about doesn't it?] I don't think there's a good answer available that's also portable. What you need is an implementation that doesn't care about the signedness of the type. You could do some really ugly tricks that would work. For example, calling a helper function with the same argument twice, and setting one of the arguments to zero, and using *that* to do the compare (the types would always match). using two compares swapping the values would tell you what you needed. You'd probably want to mark the helper private, or at least protected, and call it something like "_docompare" to put it in the implementation space. As I said... really ugly tricks. 8-). -- Terry