From owner-freebsd-current@FreeBSD.ORG Sun Jul 13 11:38:04 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 CC17E37B401 for ; Sun, 13 Jul 2003 11:38:04 -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 41B5543F93 for ; Sun, 13 Jul 2003 11:38:04 -0700 (PDT) (envelope-from leimy2k@mac.com) Received: from mac.com (smtpin08-en2 [10.13.10.153]) by smtpout.mac.com (Xserve/MantshX 2.0) with ESMTP id h6DIbZ17026487; Sun, 13 Jul 2003 11:37:35 -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 h6DIPlsr012844; Sun, 13 Jul 2003 11:37:32 -0700 (PDT) In-Reply-To: <20030713.122352.22176834.imp@bsdimp.com> References: <20030713000559.28c18be6.kabaev@mail.ru> <20030713044331.GA89785@crodrigues.org> <20030713152154.GA96653@stack.nl> <20030713.122352.22176834.imp@bsdimp.com> Mime-Version: 1.0 (Apple Message framework v578) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <1046B4F9-B561-11D7-BE3B-0003937E39E0@mac.com> Content-Transfer-Encoding: 7bit From: David Leimbach Date: Sun, 13 Jul 2003 13:37:32 -0500 To: "M. Warner Losh" X-Mailer: Apple Mail (2.578) cc: rodrigc@crodrigues.org cc: kabaev@mail.ru cc: freebsd-current@freebsd.org cc: jilles@stack.nl 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 18:38:05 -0000 On Sunday, July 13, 2003, at 1:23PM, M. Warner Losh wrote: > : > 134 #define __glibcpp_signed(T) ((T)(-1) < 0) > : #define __glibcpp_signed(T) (!((T)(-1) > 0)) > > Why not the simpler: > > #define __glibcpp_signed(T) ((T)(-1) <= 0) > > that way we have an overlap on the range of the two types, so we won't > get a warning. We know for a fact that -1 != 0 for all known machine > types (all machines are two's complement, or are required to behave as > if they are two's complement, per the standard). > You keep saying this... where is this "must behave as two's compliment stated?" > (unsigned int) -1 == 0xffffffff (assuming 32-bit int). or with a valid one's compliment C99 compliant system (unsigned int) -1 = 0xfffffffe; > > even on a one's complement's machine, without the standard conversion, > the 'type punning' conversion of -1 would yield 0xfffffffe, which is > still > 0. > Correct :). I still don't think C enforces two's compliment. Dave > Warner > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to > "freebsd-current-unsubscribe@freebsd.org"