From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Building: alloc.c:766:1: error: negative width in bit-field `_gl_verify_error_if_negative' Date: Mon, 13 Feb 2012 08:57:36 -0800 Organization: UCLA Computer Science Department Message-ID: <4F394100.2030704@cs.ucla.edu> References: <20120212110253.GA11925@acm.acm> <4F382FB0.2000506@cs.ucla.edu> <20120213130702.GA26954@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1329152291 11308 80.91.229.3 (13 Feb 2012 16:58:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Feb 2012 16:58:11 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 13 17:58:08 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RwzDo-0000WE-Iv for ged-emacs-devel@m.gmane.org; Mon, 13 Feb 2012 17:57:48 +0100 Original-Received: from localhost ([::1]:36706 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwzDn-0007We-Up for ged-emacs-devel@m.gmane.org; Mon, 13 Feb 2012 11:57:47 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:33518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwzDl-0007Tw-2q for emacs-devel@gnu.org; Mon, 13 Feb 2012 11:57:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RwzDf-0001kL-8p for emacs-devel@gnu.org; Mon, 13 Feb 2012 11:57:45 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:48751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwzDf-0001kD-4j for emacs-devel@gnu.org; Mon, 13 Feb 2012 11:57:39 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 9224EA60004; Mon, 13 Feb 2012 08:57:37 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7iMzMFfkgNSM; Mon, 13 Feb 2012 08:57:36 -0800 (PST) Original-Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 68072A60002; Mon, 13 Feb 2012 08:57:36 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120131 Thunderbird/10.0 In-Reply-To: <20120213130702.GA26954@acm.acm> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 131.179.128.62 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:148562 Archived-At: On 02/13/2012 05:07 AM, Alan Mackenzie wrote: > How can the compiler transform "INT_MAX <= PTRDIFF_MAX" into a message > about bit-field widths? That message is generated for compilers that are not known to support C11-style static assertions . In GCC 4.6.0 and later, verify(X) simply expands to _Static_assert(X). Other compilers (including older GCCs) are not known to have _Static_assert, so verify(X) expands to: struct { unsigned _gl_verify_error_if_negative: (X) ? 1 : -1; } which causes a compile-time error if X is false (the desired effect); as you've noticed, the diagnostic isn't as nice as with GCC 4.6.0 and later. This is implemented in lib/verify.h -- more commentary is there. My guess is that PTRDIFF_MAX is set incorrectly in your implementation. Emacs's 'configure' script attempts to detect that, and replace it with a correct PTRDIFF_MAX, but perhaps we need to improve 'configure' so that it detects the problem with your implementation. Can you send the compressed "gcc -E ..." output of the offending compilation, and the contents of 'config.log' and 'src/config.h' and (if present) 'lib/stdint.h'? That should help debug the situation. Also, if you could determine which standard header is defining ptrdiff_t and PTRDIFF_MAX, and what they're defined to, that might help.