From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.bugs Subject: bug#23261: 25.0.92; Undefined behavior in lib/stdint.h Date: Sun, 17 Apr 2016 13:48:10 +0000 Message-ID: References: <570B50E3.7080704@cs.ucla.edu> <570BCE13.9000006@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113f186633cf230530ae7f26 X-Trace: ger.gmane.org 1460900965 9790 80.91.229.3 (17 Apr 2016 13:49:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Apr 2016 13:49:25 +0000 (UTC) Cc: 23261@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 17 15:49:10 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1arn4Y-0005ax-3S for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Apr 2016 15:49:10 +0200 Original-Received: from localhost ([::1]:46424 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1arn4X-00014O-K6 for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Apr 2016 09:49:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1arn4T-00011k-Sz for bug-gnu-emacs@gnu.org; Sun, 17 Apr 2016 09:49:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1arn4Q-0008SF-MB for bug-gnu-emacs@gnu.org; Sun, 17 Apr 2016 09:49:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1arn4Q-0008S9-Gu for bug-gnu-emacs@gnu.org; Sun, 17 Apr 2016 09:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1arn4P-0006Mh-RF for bug-gnu-emacs@gnu.org; Sun, 17 Apr 2016 09:49:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Apr 2016 13:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23261 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23261-submit@debbugs.gnu.org id=B23261.146090090824424 (code B ref 23261); Sun, 17 Apr 2016 13:49:01 +0000 Original-Received: (at 23261) by debbugs.gnu.org; 17 Apr 2016 13:48:28 +0000 Original-Received: from localhost ([127.0.0.1]:37853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1arn3s-0006Ls-JH for submit@debbugs.gnu.org; Sun, 17 Apr 2016 09:48:28 -0400 Original-Received: from mail-lf0-f45.google.com ([209.85.215.45]:36646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1arn3q-0006Le-4M for 23261@debbugs.gnu.org; Sun, 17 Apr 2016 09:48:26 -0400 Original-Received: by mail-lf0-f45.google.com with SMTP id g184so190745035lfb.3 for <23261@debbugs.gnu.org>; Sun, 17 Apr 2016 06:48:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7yMA5NSHqdwcX0wW9ZrhQhVbbVglwKECiEF2VKcc0jU=; b=TJvDwXdVKawGlni3fwfEWTyiWF+VfsXy9ifmzpk3hDohRfxGQYE253LqPNpoVKkTi0 I0E2TaCB1qNMGJVa8oRKBMmLPsgbpZXK0keX8jlryJ7pW2FSYdS5AhCQGyzi93TgaDaB hsD1ohBiAC+UVC4rUGG6z9zUPTcE2TQpdjveO+zatbr3gLcUOcOqsdAJd5+VzujN03h8 P3imxRfFa3VQPUYnlKTPsE0t4dMA6zYDmB3ip1tOOdwFNo+ybmG32tpSB0LzzxYBP18w mvsCyxaT1kFnc5nc2GIr5xa61vatogvqTKshGMHJNaNYq777MckFffUReORVlFjkcsjA xkCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7yMA5NSHqdwcX0wW9ZrhQhVbbVglwKECiEF2VKcc0jU=; b=Tx9qe8Yh7ZuRCOv3arw1IwZAwMhFrOJVhxdDeXfDDioOUnhWKy47u+jm1Su721JfrW ZJMBi3GKHS0bBJSUcK1s1WARumondCetHoOXuk9UKCAlhNBAdJ+D9e56GET9swjf4ogK YLrgXqaXMj5TaVvW3yvCKENMOywWzhcVKlaLbSw56dNaatPchPHFkO8CwyPla0ueU0bs hGwo5MdWp9/tsphd+/KT1/q7iPnXEMsMNtfGtK4arCu26pc/rUH4N2QL9v9v/iNWgEVT FwGwBQXAqRfDqbD5/TFLSrxecy9IQEmpKEbzJuuHjRE4gq4dpCnhg+7Uonmvoev08Qbs VzLg== X-Gm-Message-State: AOPr4FVPLQXkgPo4JT4p8gxZi9BVpOvM8VUPjid6KW47AxgSOYBUX7ryZXplu1Vs0dSDMljV9LWc5qneO1XjVQ== X-Received: by 10.25.21.231 with SMTP id 100mr12786361lfv.146.1460900900095; Sun, 17 Apr 2016 06:48:20 -0700 (PDT) In-Reply-To: <570BCE13.9000006@cs.ucla.edu> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:116560 Archived-At: --001a113f186633cf230530ae7f26 Content-Type: text/plain; charset=UTF-8 Paul Eggert schrieb am Mo., 11. Apr. 2016 um 18:18 Uhr: > On 04/11/2016 12:23 AM, Paul Eggert wrote: > > > > I don't observe a problem with my clang installation (clang 3.7.0 on > > Fedora 23 x86-64). > > I managed to reproduce the problem in Gnulib by artificially pretending > to 'configure' that clang's stdint.h was busted, using './configure > gl_cv_header_working_stdint_h=no'. I installed a fix for the problem > into Gnulib here: > > > http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=705764b377ebeef7bdba1a87fafd99cd56b6f3c9 > > I ran 'admin/merge-gnulib' to propagate the fix into emacs-25, and then > merged emacs-25 into master using the procedure described in > 'admin/notes/git-workflow'. > > Please give this a try on your setup. Thanks, the relevant warning messages are now gone. > Do a 'make clean' before running > 'make'. If 'make' is still building lib/stdint.h, please investigate why > './configure' decides that clang's stdint.h is buggy. > > > Because I think there's an actual bug in stdint.h on OS X. UINT8_C(n) is required to expand to a constant that should be promoted to the same type that uint8_t(0) gets promoted to, which is int. However, on OS X, UINT8_C(n) expands to n##U, which gets promoted to unsigned int. By contrast, the definition in GCC 5.3 is just 'n'. The question here is whether Gnulib should really redefine all macros if only a small subset (here: UINT8_C and UINT16_C) are incorrect. --001a113f186633cf230530ae7f26 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Paul E= ggert <eggert@cs.ucla.edu> = schrieb am Mo., 11. Apr. 2016 um 18:18=C2=A0Uhr:
On 04/11/2016 12:23 AM, Paul Eggert wrote:
>
> I don't observe a problem with my clang installation (clang 3.7.0 = on
> Fedora 23 x86-64).

I managed to reproduce the problem in Gnulib by artificially pretending
to 'configure' that clang's stdint.h was busted, using './c= onfigure
gl_cv_header_working_stdint_h=3Dno'. I installed a fix for the problem<= br> into Gnulib here:

htt= p://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=3D705764b377ebeef7bdba1= a87fafd99cd56b6f3c9

I ran 'admin/merge-gnulib' to propagate the fix into emacs-25, and = then
merged emacs-25 into master using the procedure described in
'admin/notes/git-workflow'.

Please give this a try on your setup.

Thank= s, the relevant warning messages are now gone.
=C2=A0
Do a 'make clean' before running
'make'. If 'make' is still building lib/stdint.h, please in= vestigate why
'./configure' decides that clang's stdint.h is buggy.



Because I think there's an actual = bug in stdint.h on OS X. UINT8_C(n) is required to expand to a constant tha= t should be promoted to the same type that uint8_t(0) gets promoted to, whi= ch is int. However, on OS X, UINT8_C(n) expands to n##U, which gets promote= d to unsigned int. By contrast, the definition in GCC 5.3 is just 'n= 9;.

The question here is whether Gnulib should rea= lly redefine all macros if only a small subset (here: UINT8_C and UINT16_C)= are incorrect.
--001a113f186633cf230530ae7f26--