all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Cyril Arnould <cyril.arnould@outlook.com>
Cc: 70889@debbugs.gnu.org
Subject: bug#70889: 29.3; GCC14.1 MinGW compilation error
Date: Sun, 12 May 2024 13:31:34 +0300	[thread overview]
Message-ID: <86ttj3z5h5.fsf@gnu.org> (raw)
In-Reply-To: <41f56bc9-8f54-412c-a6fc-ae7a343f92dd@gmail.com> (message from Cyril Arnould on Sun, 12 May 2024 09:29:02 +0200)

> Date: Sun, 12 May 2024 09:29:02 +0200
> From: Cyril Arnould <2006parcy@gmail.com>
> 
> I wanted to check how the MinGW related issues #63365 and #63752 behave
> under GCC 14.1, however I did not get that far. Running the following:
> 
> 
> git clone https://git.savannah.gnu.org/git/emacs.git
> cd emacs
> ./autogen.sh
> ./configure
> make
> 
> 
> I get the error:
> 
> 
> sysdep.c: In function 'get_child_status':
> sysdep.c:479:13: error: implicit declaration of function 'waitpid' 
> [-Wimplicit-function-declaration]
>    479 |       pid = waitpid (child, status, options);
>        |             ^~~~~~~
> sysdep.c:479:13: warning: nested extern declaration of 'waitpid' 
> [-Wnested-externs]

I don't understand how this happens.  sysdep.c includes syswait.h:

  #include "syswait.h"

syswait.h does this:

  #ifdef HAVE_SYS_WAIT_H	/* We have sys/wait.h with POSIXish definitions.  */
  #include <sys/wait.h>
  #endif  /* !HAVE_SYS_WAIT_H */

The MS-Windows build does define HAVE_SYS_WAIT_H:

  /* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
  #define HAVE_SYS_WAIT_H 1

because we have the emulation of that header in nt/inc/sys/wait.h, and
the compiler flags include that directory, see src/Makefile:

  CPPFLAGS = -mtune=pentium4   -DUSE_CRT_DLL=1 -I ${abs_top_srcdir}/nt/inc

So why doesn't this work in your case? which of the above parts of the
puzzle doesn't work?

> sysdep.c: In function 'child_status_changed':
> sysdep.c:525:43: error: 'WNOHANG' undeclared (first use in this function)
>    525 |   return get_child_status (child, status, WNOHANG | options, 0);
>        |                                           ^~~~~~~
> sysdep.c:525:43: note: each undeclared identifier is reported only once 
> for each function it appears in
> sysdep.c:526:1: warning: control reaches end of non-void function 
> [-Wreturn-type]

Same here: WNOHANG is defined in nt/inc/sys/wait.h.

> Currently I'm on commit 67b1da215c9. According to the GCC 14 porting
> page "It is no longer possible to call a function that has not been
> declared", so I guess that's the issue here. I've noticed that in
> src/syswait.c, <sys/wait.h> is only included if HAVE_SYS_WAIT_H is
> defined, which it isn't.

So please try to figure out how come HAVE_SYS_WAIT_H is not defined in
your case.  It should be.  The first place to look is in config.log.
In my case I have

  configure:14468: checking for sys/wait.h that is POSIX.1 compatible
  configure:14501: result: yes

> For the record, I run into an internal compiler issue in thread.c
> after that, but that's not on emacs to solve I guess.

Internal compiler errors are GCC bugs, yes.





  parent reply	other threads:[~2024-05-12 10:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-12  7:29 bug#70889: 29.3; GCC14.1 MinGW compilation error Cyril Arnould
2024-05-12  8:24 ` bug#70890: " Cyril Arnould
2024-05-12 10:22   ` Eli Zaretskii
2024-05-12 10:31 ` Eli Zaretskii [this message]
2024-05-12 12:52   ` bug#70889: " Cyril Arnould
2024-05-12 14:49     ` Eli Zaretskii
2024-05-12 15:04       ` Cyril Arnould
2024-05-12 15:39         ` Eli Zaretskii
2024-05-12 16:21           ` Cyril Arnould
2024-05-12 17:16             ` Eli Zaretskii
2024-05-12 19:18               ` Paul Eggert
2024-05-13  4:43                 ` Eli Zaretskii
2024-05-17 17:19                   ` Cyril Arnould
2024-05-17 17:41                     ` Eli Zaretskii
2024-05-19  8:01                   ` Eli Zaretskii
2024-05-19 10:06                     ` Cyril Arnould
2024-05-19 10:24                       ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=86ttj3z5h5.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=70889@debbugs.gnu.org \
    --cc=cyril.arnould@outlook.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.