From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: unexmacosx.c and limits.h problem Date: Sat, 17 Sep 2016 11:14:10 -0700 Organization: UCLA Computer Science Department Message-ID: References: <17A5977B-7474-4740-BEC7-CFF27E57FC73@play-bow.org> <83d1k24vvr.fsf@gnu.org> <83a8f64udh.fsf@gnu.org> <831t0i4pez.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------9D862A5A5DAF7215D2027F6B" X-Trace: blaine.gmane.org 1474136119 7285 195.159.176.226 (17 Sep 2016 18:15:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 17 Sep 2016 18:15:19 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 Cc: halley@play-bow.org, emacs-devel@gnu.org To: Eli Zaretskii , Richard Copley Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 17 20:15:14 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blK8s-00010C-OL for ged-emacs-devel@m.gmane.org; Sat, 17 Sep 2016 20:15:10 +0200 Original-Received: from localhost ([::1]:47041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blK8q-0006b4-Tp for ged-emacs-devel@m.gmane.org; Sat, 17 Sep 2016 14:15:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blK8B-0006at-EU for emacs-devel@gnu.org; Sat, 17 Sep 2016 14:14:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1blK86-0001Zx-RO for emacs-devel@gnu.org; Sat, 17 Sep 2016 14:14:24 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:47726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blK80-0001Xf-O9; Sat, 17 Sep 2016 14:14:16 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 08F75160D51; Sat, 17 Sep 2016 11:14:16 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 3LcBE4KpjG5o; Sat, 17 Sep 2016 11:14:14 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 8EDCB161200; Sat, 17 Sep 2016 11:14:14 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id l4sDBFKJQ9Fa; Sat, 17 Sep 2016 11:14:14 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [47.153.191.53]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 63FCA160D51; Sat, 17 Sep 2016 11:14:14 -0700 (PDT) In-Reply-To: <831t0i4pez.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:207496 Archived-At: This is a multi-part message in MIME format. --------------9D862A5A5DAF7215D2027F6B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Eli Zaretskii wrote: > Which to me sounds like lib/limits.h is not a good place to define > these constants, or at least Emacs shouldn't rely on Gnulib's limits.h > to do its magic on all systems. The ISO technical spec says the settings should go into , and i= f we=20 put them somewhere else that will just make things more confusing in the = long run. I installed the attached patch, which should fix the immediate problem. The fundamental problem here is that Emacs over the years has = bloated=20 to contain many things that it should not. should always be in= cluded=20 first -- this is a key assumption of Autoconf and Gnulib -- and should co= ntain=20 only stuff that can appear in an included-first file. It should therefore= not=20 contain things like "#include " that can cause trouble in the c= ases=20 we're talking about. It's understandable why config.h has bloated, as it's a convenient catcha= ll for=20 stuff that has to be visible "everywhare" at the C level. The=20 visibility-"everywhere" problem needs to be addressed in some other way, = that's=20 all. I'll look into fixing this. --------------9D862A5A5DAF7215D2027F6B Content-Type: text/x-diff; name="0001-Define-_GNU_SOURCE-in-files-delaying-config.h.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-Define-_GNU_SOURCE-in-files-delaying-config.h.patch" =46rom 8fdc22328b0932f2360f722e36a7f1ac7e5e5a20 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 17 Sep 2016 11:05:07 -0700 Subject: [PATCH] Define _GNU_SOURCE in files delaying config.h Problem reported by Richard Copley in: http://lists.gnu.org/archive/html/emacs-devel/2016-09/msg00440.html * src/w32.c, src/w32notify.c, src/w32proc.c (_GNU_SOURCE): Define early. --- src/unexmacosx.c | 5 +---- src/w32.c | 3 +++ src/w32notify.c | 3 +++ src/w32proc.c | 3 +++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/unexmacosx.c b/src/unexmacosx.c index 2ba67df..185a9d1 100644 --- a/src/unexmacosx.c +++ b/src/unexmacosx.c @@ -85,11 +85,8 @@ along with GNU Emacs. If not, see . */ be changed accordingly. */ =20 -/* Make symbols like LLONG_WIDTH visible when the Gnulib - is included before . */ -#ifndef _GNU_SOURCE +/* Enable GNU extensions in gnulib replacement headers. */ #define _GNU_SOURCE 1 -#endif =20 /* config.h #define:s malloc/realloc/free and then includes stdlib.h. We want the undefined versions, but if config.h includes stdlib.h diff --git a/src/w32.c b/src/w32.c index 1db3426..6cb8e74 100644 --- a/src/w32.c +++ b/src/w32.c @@ -21,6 +21,9 @@ along with GNU Emacs. If not, see . */ Geoff Voelker (voelker@cs.washington.edu) 7-2= 9-94 */ =20 +/* Enable GNU extensions in gnulib replacement headers. */ +#define _GNU_SOURCE 1 + #include #include /* for offsetof */ #include diff --git a/src/w32notify.c b/src/w32notify.c index d4a113a..15e8a86 100644 --- a/src/w32notify.c +++ b/src/w32notify.c @@ -81,6 +81,9 @@ along with GNU Emacs. If not, see . */ thread to exit. The main thread waits for some time for the worker thread to exit, and if it doesn't, terminates it forcibly. */ =20 +/* Enable GNU extensions in gnulib replacement headers. */ +#define _GNU_SOURCE 1 + #include #include =20 diff --git a/src/w32proc.c b/src/w32proc.c index 90cef32..e23b1b3 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -22,6 +22,9 @@ along with GNU Emacs. If not, see . */ Adapted from alarm.c by Tim Fleehart */ =20 +/* Enable GNU extensions in gnulib replacement headers. */ +#define _GNU_SOURCE 1 + #include #include #include --=20 2.7.4 --------------9D862A5A5DAF7215D2027F6B--