GNU bug report logs -
#78160
Emacs fail to build with GCC 15
Previous Next
Reported by: MAN ONE <pRoMMMModE <at> outlook.com>
Date: Wed, 30 Apr 2025 06:57:03 UTC
Severity: normal
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Wed, 30 Apr 2025 14:17:27 +0300
with message-id <86ecx9oq48.fsf <at> gnu.org>
and subject line Re: bug#78160: Emacs fail to build with GCC 15
has caused the debbugs.gnu.org bug report #78160,
regarding Emacs fail to build with GCC 15
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
78160: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78160
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Earlier this week Msys2 upgraded GCC to version 15.1.0, which lead to this build error:
emacsclient.c:1718:9: warning: no previous declaration for 'set_fg' [-Wmissing-variable-de
clarations]
1718 | FARPROC set_fg; /* Pointer to AllowSetForegroundWindow. */
| ^~~~~~
emacsclient.c:1719:9: warning: no previous declaration for 'get_wc' [-Wmissing-variable-de
clarations]
1719 | FARPROC get_wc; /* Pointer to RealGetWindowClassA. */
| ^~~~~~
emacsclient.c: In function 'w32_find_emacs_process':
emacsclient.c:1759:9: error: too many arguments to function 'get_wc'; expected 0, have 3
1759 | if (! get_wc (hWnd, class, sizeof (class))
| ^~~~~~ ~~~~
emacsclient.c:1770:3: error: too many arguments to function 'set_fg'; expected 0, have 1
1770 | set_fg (emacs_pid);
| ^~~~~~ ~~~~~~~~~
emacsclient.c:1718:9: warning: no previous declaration for 'set_fg' [-Wmissing-variable-de
clarations]
1718 | FARPROC set_fg; /* Pointer to AllowSetForegroundWindow. */
| ^~~~~~
emacsclient.c:1719:9: warning: no previous declaration for 'get_wc' [-Wmissing-variable-de
clarations]
1719 | FARPROC get_wc; /* Pointer to RealGetWindowClassA. */
| ^~~~~~
emacsclient.c: In function 'w32_find_emacs_process':
emacsclient.c:1759:9: error: too many arguments to function 'get_wc'; expected 0, have 3
1759 | if (! get_wc (hWnd, class, sizeof (class))
| ^~~~~~ ~~~~
emacsclient.c:1770:3: error: too many arguments to function 'set_fg'; expected 0, have 1
1770 | set_fg (emacs_pid);
| ^~~~~~ ~~~~~~~~~
make[2]: *** [Makefile:446: emacsclientw.exe] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [Makefile:439: emacsclient.exe] Error 1
make[2]: Leaving directory '/e/home/repo/emacs/lib-src'
make[1]: *** [Makefile:529: lib-src] Error 2
make[1]: *** Waiting for unfinished jobs....
I think the cause is GCC 15 now use C23 by default[1], and appending ` -std=gnu17 ` compiler flag does solve the problem.
[1]https://gcc.gnu.org/gcc-15/porting_to.html#c23
[Message part 3 (message/rfc822, inline)]
> From: MAN ONE <pRoMMMModE <at> outlook.com>
> CC: "78160 <at> debbugs.gnu.org" <78160 <at> debbugs.gnu.org>
> Date: Wed, 30 Apr 2025 11:02:26 +0000
> msip_labels:
>
> The second patch produce no compilation error or warnings, emacsclient.exe and emacsclientw.exe also working, I think the second patch does the trick.
Thanks, installed on both the emacs-30 and the master branch, and
closing this bug.
As for the other warnings, feel free to submit a separate bug report
with them, so we could consider how and on which branch to fix them.
This bug report was last modified 23 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.