unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Copley <rcopley@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Bob Halley <halley@play-bow.org>,
	Paul Eggert <eggert@cs.ucla.edu>,
	Emacs Development <emacs-devel@gnu.org>
Subject: Re: unexmacosx.c and limits.h problem
Date: Sat, 17 Sep 2016 13:40:52 +0100	[thread overview]
Message-ID: <CAPM58ojmw-caM3r4PcaanFwG=j97+Wk_f3LYfqJ1P9PRFJme4w@mail.gmail.com> (raw)
In-Reply-To: <CAPM58oj074-37FTn+ZhC1Hpm6o-qpCxoGU-3wm748AYcFjVBTQ@mail.gmail.com>

On 17 September 2016 at 13:28, Richard Copley <rcopley@gmail.com> wrote:
> On 17 September 2016 at 12:51, Eli Zaretskii <eliz@gnu.org> wrote:
>>> From: Richard Copley <rcopley@gmail.com>
>>> Date: Sat, 17 Sep 2016 12:31:36 +0100
>>> Cc: Paul Eggert <eggert@cs.ucla.edu>, Bob Halley <halley@play-bow.org>,
>>>       Emacs Development <emacs-devel@gnu.org>
>>>
>>> >>> >> +#ifndef _GNU_SOURCE
>>> >>> >> +#define _GNU_SOURCE 1
>>> >>> >> +#endif
>>> >>> >
>>> >>> >
>>> >>> > Thanks, I installed that into Emacs master.
>>> >>>
>>> >>> The Windows build is broken too (with MSYS2), presumably for a similar
>>> >>> reason.
>>> >>
>>> >> It isn't broken here.  Can you show the error messages?
>>> >
>>> > Sure, give me a few minutes. Did you reconfigure? You need the
>>> > generated limits.h.
>>>
>>> Also, this is with 64-bit GCC 6.1.0.
>>>
>>> In file included from G:/emacs/repo/emacs/src/w32.c:87:0:
>>> G:/emacs/repo/emacs/src/lisp.h:93:26: error: 'LLONG_WIDTH' undeclared
>>> here (not in a function)
>>>  enum { EMACS_INT_WIDTH = LLONG_WIDTH };
>>>                           ^~~~~~~~~~~
>>>
>>> In file included from G:/emacs/repo/emacs/src/w32proc.c:54:0:
>>> G:/emacs/repo/emacs/src/lisp.h:93:26: error: 'LLONG_WIDTH' undeclared
>>> here (not in a function)
>>>  enum { EMACS_INT_WIDTH = LLONG_WIDTH };
>>>                           ^~~~~~~~~~~
>>
>> I don't understand how this could happen.  Take w32proc.c, for
>> example: it includes config.h _before_ lisp.h, and on my system
>> config.h has these:
>>   /* Enable GNU extensions on systems that have them.  */
>>   #ifndef _GNU_SOURCE
>>   # define _GNU_SOURCE 1
>>   #endif
>>   [...]
>>   /* Enable extensions specified by ISO/IEC TS 18661-1:2014.  */
>>   #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
>>   # define __STDC_WANT_IEC_60559_BFP_EXT__ 1
>>   #endif
>>
>> So by the time limits.h gets included (via lib/stdint.h, which is
>> included by nt/inc/stdint.h, which is included by nt/inc/ms-w32.h),
>> both _GNU_SOURCE and __STDC_WANT_IEC_60559_BFP_EXT__ are already
>> defined, and the definitions of LLONG_WIDTH in lib/limits.h should
>> have been processed.
>>
>> Which part(s) of this don't work on your system, and why?
>>
>> To find out what happens during preprocessing, I did this:
>>
>>   cd src
>>   make w32proc.o -W w32proc.c V=1
>>
>> Then I copied the command displayed by Make, replaced -c with -E,
>> appended "-o w32proc.ii", ran the command, and looked inside
>> w32proc.ii to see how the preprocessor included the various headers
>> and defined the macros.
>>
>> (My GCC version is 5.3.0, and this is a 32-bit build with wide ints.)
>
> My preprocessed file doesn't show the #include or #define directives.
> It sounds like yours does. Apparently another difference between our
> toolchains. I obtained the preprocessed file the same way you did.
>
> There are line/file preprocessor comments which probably contain
> enough information to deduce what happened, but it's hard going.
>
> I'll keep trying, unless you have any other tips?
>
> I suppose the preprocessed source is no use to you, since you don't
> have the same headers unless you update your MSYS, and if you do that
> you won't need anything from me.

I added an #error to limits.h; as you can see from the output below,
limits.h is already included via the system stdlib.h, which is
included near the top of w32proc.c, so the direct #include of limits.h
after config.h in w32proc.c has no effect.

In file included from
C:/msys64/mingw64/x86_64-w64-mingw32/include/stdlib.h:10:0,
                 from G:/emacs/repo/emacs/src/w32proc.c:27:
../lib/limits.h:21:2: error: #error limits
 #error limits
  ^~~~~



  reply	other threads:[~2016-09-17 12:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-16 23:04 unexmacosx.c and limits.h problem Bob Halley
2016-09-17  1:02 ` Paul Eggert
2016-09-17 11:03   ` Richard Copley
2016-09-17 11:18     ` Eli Zaretskii
2016-09-17 11:28       ` Richard Copley
2016-09-17 11:31         ` Richard Copley
2016-09-17 11:51           ` Eli Zaretskii
2016-09-17 12:28             ` Richard Copley
2016-09-17 12:40               ` Richard Copley [this message]
2016-09-17 12:56                 ` Richard Copley
2016-09-17 13:38                   ` Eli Zaretskii
2016-09-17 18:14                     ` Paul Eggert
2016-09-17 12:41               ` Eli Zaretskii
2016-09-17 12:46                 ` Richard Copley
2016-09-17 11:34         ` Eli Zaretskii
2016-09-17 11:38           ` Richard Copley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPM58ojmw-caM3r4PcaanFwG=j97+Wk_f3LYfqJ1P9PRFJme4w@mail.gmail.com' \
    --to=rcopley@gmail.com \
    --cc=eggert@cs.ucla.edu \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=halley@play-bow.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).