WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Compiler Issue With Function Declarations With 15.2.1 #470

@notabelincoln

Description

@notabelincoln

Default configuration settings causing errors in compile

Commit

969137d1e2cf6b99785cb320b882a05181cfca01

Overview

Running make after configuring with no additional arguments:

./configure
make

works fine up until this point in the compilation:

gcc -g -m64 -fPIC -Werror=implicit-function-declaration -Wimplicit-int -fPIC -I.. -DCAD_DIR=\"/usr/local/lib\" -DBIN_DIR=\"/usr/local/bin\" -DTCL_DIR=\"/usr/local/lib/magic/tcl\" -DUSE_TCL_STUBS -DUSE_TK_STUBS -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -Drestrict=__restrict -DSTDC_HEADERS=1 -DHAVE__BOOL=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_GETRLIMIT=1 -DHAVE_SETRLIMIT=1 -DHAVE_SYS_MMAN_H=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_PATHS_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TERMIO_H=1 -DHAVE_TERMIOS_H=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SGTTY_H=1 -DHAVE_DIRENT_H=1 -DHAVE_STRUCT_DIRENT_D_TYPE=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DHAVE_ZLIB=1 -DFILE_LOCKS=1 -DCALMA_MODULE=1 -DCIF_MODULE=1 -DPLOT_MODULE=1 -DLEF_MODULE=1 -DROUTE_MODULE=1 -DUSE_NEW_MACROS=1 -DHAVE_LIBGL=1 -DVECTOR_FONTS=1 -DHAVE_LIBCAIRO=1 -DMAGIC_WRAPPER=1 -DTHREE_D=1 -Dlinux=1 -DSYSV=1 -DISC=1 -DMAGIC_VERSION=\"8.3\" -DMAGIC_REVISION=\"573\" -DMAGIC_COMMIT=\"969137d1e2cf6b99785cb320b882a05181cfca01\" "-DMAGIC_BUILDDATE=\"Fri Nov 7 12:36:02 AM CST 2025\"" -DGCORE=\"no\" -DSHDLIB_EXT=\".so\" -DNDEBUG -c CMWmain.c
CMWmain.c: In functionCMWcreate’:
CMWmain.c:170:5: error: too many arguments to functionWindSetWindowAreas’; expected 0, have 1
 170 | WindSetWindowAreas(window);
 | ^~~~~~~~~~~~~~~~~~ ~~~~~~
In file included from CMWmain.c:28:
../windows/windows.h:249:13: note: declared here
 249 | extern void WindSetWindowAreas();
 | ^~~~~~~~~~~~~~~~~~
CMWmain.c: In functionCMWreposition’:
CMWmain.c:227:9: error: too many arguments to functionWindMove’; expected 0, have 2
 227 | WindMove(window, &colorWindowRect);
 | ^~~~~~~~ ~~~~~~
../windows/windows.h:266:13: note: declared here
 266 | extern void WindMove();
 | ^~~~~~~~
In file included from CMWmain.c:36:
CMWmain.c: In functionCMWredisplay’:
../graphics/graphics.h:181:17: error: too many arguments to functionGrLockPtr’; expected 0, have 2
 181 | #define GrLock (*GrLockPtr)
 | ~^~~~~~~~~~~
CMWmain.c:261:5: note: in expansion of macroGrLock261 | GrLock(w, TRUE);
 | ^~~~~~
CMWmain.c:267:5: error: too many arguments to functionWindSurfaceToScreen’; expected 0, have 3
 267 | WindSurfaceToScreen(w, rootArea, &screenR);
 | ^~~~~~~~~~~~~~~~~~~ ~
../windows/windows.h:281:13: note: declared here
 281 | extern void WindSurfaceToScreen();
 | ^~~~~~~~~~~~~~~~~~~
CMWmain.c:268:5: error: too many arguments to functionGrClipBox’; expected 0, have 2
 268 | GrClipBox(clipArea, STYLE_ERASEALL);
 | ^~~~~~~~~ ~~~~~~~~
../graphics/graphics.h:57:13: note: declared here
 57 | extern void GrClipBox();
 | ^~~~~~~~~
CMWmain.c:271:12: error: too many arguments to functionGrGetColor’; expected 0, have 4
 271 | (void) GrGetColor(cr->cmw_color, &r, &g, &b);
 | ^~~~~~~~~~ ~~~~~~~~~~~~~
../graphics/graphics.h:87:13: note: declared here
 87 | extern bool GrGetColor(), GrPutColor();
 | ^~~~~~~~~~
CMWmain.c:292:13: error: too many arguments to functionWindSurfaceToScreen’; expected 0, have 3
 292 | WindSurfaceToScreen(w, &rect, &screenR);
 | ^~~~~~~~~~~~~~~~~~~ ~
../windows/windows.h:281:13: note: declared here
 281 | extern void WindSurfaceToScreen();
 | ^~~~~~~~~~~~~~~~~~~
CMWmain.c:293:13: error: too many arguments to functionGrClipBox’; expected 0, have 2
 293 | GrClipBox(&screenR, cb->cb_style);
 | ^~~~~~~~~ ~~~~~~~~
../graphics/graphics.h:57:13: note: declared here
 57 | extern void GrClipBox();
 | ^~~~~~~~~
CMWmain.c:295:13: error: too many arguments to functionWindSurfaceToScreen’; expected 0, have 3
 295 | WindSurfaceToScreen(w, &cb->cb_rect, &screenR);
 | ^~~~~~~~~~~~~~~~~~~ ~
../windows/windows.h:281:13: note: declared here
 281 | extern void WindSurfaceToScreen();
 | ^~~~~~~~~~~~~~~~~~~
CMWmain.c:296:13: error: too many arguments to functionGrClipBox’; expected 0, have 2
 296 | GrClipBox(&screenR, STYLE_BBOX);
 | ^~~~~~~~~ ~~~~~~~~
../graphics/graphics.h:57:13: note: declared here
 57 | extern void GrClipBox();
 | ^~~~~~~~~
CMWmain.c:302:13: error: too many arguments to functionWindSurfaceToScreen’; expected 0, have 3
 302 | WindSurfaceToScreen(w, &cb->cb_textRect, &screenR);
 | ^~~~~~~~~~~~~~~~~~~ ~
../windows/windows.h:281:13: note: declared here
 281 | extern void WindSurfaceToScreen();
 | ^~~~~~~~~~~~~~~~~~~
CMWmain.c:306:13: error: too many arguments to functionGrPutText’; expected 0, have 8
 306 | GrPutText(cb->cb_name, STYLE_BBOX, &screenP,
 | ^~~~~~~~~ ~~~~~~~~~~~
../graphics/graphics.h:59:13: note: declared here
 59 | extern bool GrPutText();
 | ^~~~~~~~~
CMWmain.c:318:13: error: too many arguments to functionWindSurfaceToScreen’; expected 0, have 3
 318 | WindSurfaceToScreen(w, &cp->cp_rect, &screenR);
 | ^~~~~~~~~~~~~~~~~~~ ~
../windows/windows.h:281:13: note: declared here
 281 | extern void WindSurfaceToScreen();
 | ^~~~~~~~~~~~~~~~~~~
CMWmain.c:319:13: error: too many arguments to functionGrClipBox’; expected 0, have 2
 319 | GrClipBox(&screenR, STYLE_BBOX);
 | ^~~~~~~~~ ~~~~~~~~
../graphics/graphics.h:57:13: note: declared here
 57 | extern void GrClipBox();
 | ^~~~~~~~~
CMWmain.c:325:13: error: too many arguments to functionGrPutText’; expected 0, have 8
 325 | GrPutText(string, STYLE_BBOX, &screenP, GEO_CENTER, GR_TEXT_LARGE,
 | ^~~~~~~~~ ~~~~~~
../graphics/graphics.h:59:13: note: declared here
 59 | extern bool GrPutText();
 | ^~~~~~~~~
CMWmain.c:339:9: error: too many arguments to functionWindSurfaceToScreen’; expected 0, have 3
 339 | WindSurfaceToScreen(w, &cmwCurrentColorArea, &screenR);
 | ^~~~~~~~~~~~~~~~~~~ ~
../windows/windows.h:281:13: note: declared here
 281 | extern void WindSurfaceToScreen();
 | ^~~~~~~~~~~~~~~~~~~
CMWmain.c:340:9: error: too many arguments to functionGrClipBox’; expected 0, have 2
 340 | GrClipBox(&screenR, STYLE_CMEDIT);
 | ^~~~~~~~~ ~~~~~~~~
../graphics/graphics.h:57:13: note: declared here
 57 | extern void GrClipBox();
 | ^~~~~~~~~
CMWmain.c:341:9: error: too many arguments to functionGrClipBox’; expected 0, have 2
 341 | GrClipBox(&screenR, STYLE_BBOX);
 | ^~~~~~~~~ ~~~~~~~~
../graphics/graphics.h:57:13: note: declared here
 57 | extern void GrClipBox();
 | ^~~~~~~~~
CMWmain.c:345:9: error: too many arguments to functionWindSurfaceToScreen’; expected 0, have 3
 345 | WindSurfaceToScreen(w, &cmwCurrentColorTextBox, &screenR);
 | ^~~~~~~~~~~~~~~~~~~ ~
../windows/windows.h:281:13: note: declared here
 281 | extern void WindSurfaceToScreen();
 | ^~~~~~~~~~~~~~~~~~~
CMWmain.c:349:9: error: too many arguments to functionGrPutText’; expected 0, have 8
 349 | GrPutText(cmwCurrentColorText, STYLE_BBOX, &screenP,
 | ^~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
../graphics/graphics.h:59:13: note: declared here
 59 | extern bool GrPutText();
 | ^~~~~~~~~
../graphics/graphics.h:182:19: error: too many arguments to functionGrUnlockPtr’; expected 0, have 1
 182 | #define GrUnlock (*GrUnlockPtr)
 | ~^~~~~~~~~~~~~
CMWmain.c:354:5: note: in expansion of macroGrUnlock354 | GrUnlock(w);
 | ^~~~~~~~
CMWmain.c: In functionCMWloadWindow’:
CMWmain.c:386:5: error: too many arguments to functionWindCaption’; expected 0, have 2
 386 | WindCaption(w, caption);
 | ^~~~~~~~~~~ ~
../windows/windows.h:287:13: note: declared here
 287 | extern void WindCaption();
 | ^~~~~~~~~~~
CMWmain.c:387:5: error: too many arguments to functionWindAreaChanged’; expected 0, have 2
 387 | WindAreaChanged(w, (Rect *) NULL);
 | ^~~~~~~~~~~~~~~ ~
../windows/windows.h:288:13: note: declared here
 288 | extern void WindAreaChanged();
 | ^~~~~~~~~~~~~~~
CMWmain.c:390:5: error: too many arguments to functionWindMove’; expected 0, have 2
 390 | WindMove(w, &colorWindowRect);
 | ^~~~~~~~ ~
../windows/windows.h:266:13: note: declared here
 266 | extern void WindMove();
 | ^~~~~~~~
CMWmain.c: In functionCMWinit’:
CMWmain.c:412:19: error: too many arguments to functionWindAddClient’; expected 0, have 9
 412 | CMWclientID = WindAddClient("color", CMWcreate, CMWdelete,
 | ^~~~~~~~~~~~~ ~~~~~~~
../windows/windows.h:242:19: note: declared here
 242 | extern WindClient WindAddClient();
 | ^~~~~~~~~~~~~
CMWmain.c:422:5: error: too many arguments to functionWindAddCommand’; expected 0, have 4
 422 | WindAddCommand(CMWclientID,
 | ^~~~~~~~~~~~~~ ~~~~~~~~~~~
../windows/windows.h:252:13: note: declared here
 252 | extern void WindAddCommand();
 | ^~~~~~~~~~~~~~
CMWmain.c:425:5: error: too many arguments to functionWindAddCommand’; expected 0, have 4
 425 | WindAddCommand(CMWclientID,
 | ^~~~~~~~~~~~~~ ~~~~~~~~~~~
../windows/windows.h:252:13: note: declared here
 252 | extern void WindAddCommand();
 | ^~~~~~~~~~~~~~
CMWmain.c:428:5: error: too many arguments to functionWindAddCommand’; expected 0, have 4
 428 | WindAddCommand(CMWclientID,
 | ^~~~~~~~~~~~~~ ~~~~~~~~~~~
../windows/windows.h:252:13: note: declared here
 252 | extern void WindAddCommand();
 | ^~~~~~~~~~~~~~
CMWmain.c:432:5: error: too many arguments to functionWindAddCommand’; expected 0, have 4
 432 | WindAddCommand(CMWclientID,
 | ^~~~~~~~~~~~~~ ~~~~~~~~~~~
../windows/windows.h:252:13: note: declared here
 252 | extern void WindAddCommand();

Environment

OS

Fedora 42 WSL

GCC Version

15.2.1

Potential Cause and Fix

It appears the issue is that the default GCC C standard changed to C23 (equivalent to passing -std=c23 or -std=gnu23 the compiler), meaning functions without any arguments in the declaration, such as the function WindAddCommand() no longer accept arguments when called. I managed to fix this issue by adding the CFLAGS=-std=gnu17 to my configuration:

./configure CFLAGS=-std=gnu17 [...]
make

I'm admittedly not good with autoconf so I'll trust someone with more knowledge than myself to make the appropriate change(s).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions