Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C23 conformance with prototype with no parameter #106

Closed
mtasaka opened this issue Jan 14, 2025 · 0 comments · Fixed by #107
Closed

C23 conformance with prototype with no parameter #106

mtasaka opened this issue Jan 14, 2025 · 0 comments · Fixed by #107

Comments

@mtasaka
Copy link
Contributor

mtasaka commented Jan 14, 2025

(developing) gcc15 now defaults to -std=gnu23 (C23) and libfm https://github.com/lxde/libfm/tree/2d94c3c8c4a2c4e252a79da3ef2b6a70e9ec37e1 fails to compile with C23:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/builddir/build/BUILD/libfm-1.3.2_20250109git2d94c3c8-build/libfm-1.3.2-20250109git2d94c3c8/libfm/_BUILDDIR_gtk2/../src -I.. -I/builddir/build/BUILD/libfm-1.3.2_20250109git2d94c3c8-build/libfm-1.3.2-20250109git2d94c3c8/libfm/_BUILDDIR_gtk2/../src/base -I/builddir/build/BUILD/libfm-1.3.2_20250109git2d94c3c8-build/libfm-1.3.2-20250109git2d94c3c8/libfm/_BUILDDIR_gtk2/../src/job -DPACKAGE_LOCALE_DIR=\"/usr/share/locale\" -Werror-implicit-function-declaration -D_LARGEFILE_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS -I/usr/include/gio-unix-2.0 -DWITH_GZFILEOP -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I/usr/include/menu-cache -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I/usr/include/dbus-1.0 -I/usr/lib64/pkgconfig/../../include/dbus-1.0 -I/usr/lib64/pkgconfig/../../lib64/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-6 -pthread -DPACKAGE_DATA_DIR=\"/usr/share/libfm\" -DPACKAGE_MODULES_DIR=\"/usr/lib64/libfm/modules\" -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -c /builddir/build/BUILD/libfm-1.3.2_20250109git2d94c3c8-build/libfm-1.3.2-20250109git2d94c3c8/libfm/_BUILDDIR_gtk2/../src/base/fm-dummy-monitor.c  -fPIC -DPIC -o base/.libs/libfm_la-fm-dummy-monitor.o
/builddir/build/BUILD/libfm-1.3.2_20250109git2d94c3c8-build/libfm-1.3.2-20250109git2d94c3c8/libfm/_BUILDDIR_gtk2/../src/base/fm-dummy-monitor.c: In function 'fm_dummy_monitor_class_init':
/builddir/build/BUILD/libfm-1.3.2_20250109git2d94c3c8-build/libfm-1.3.2-20250109git2d94c3c8/libfm/_BUILDDIR_gtk2/../src/base/fm-dummy-monitor.c:48:22: error: assignment to 'gboolean (*)(GFileMonitor *)' {aka 'int (*)(struct _GFileMonitor *)'} from incompatible pointer type 'gboolean (*)(void)' {aka 'int (*)(void)'} [-Wincompatible-pointer-types]
   48 |     fm_class->cancel = cancel;
      |                      ^
make[4]: *** [Makefile:2482: base/libfm_la-fm-dummy-monitor.lo] Error 1
mtasaka added a commit to mtasaka/libfm that referenced this issue Jan 14, 2025
C23 now regards function declaration without a parameter list
as that with no parameter (i.e. having `(void)`).

Specify parameter list explicitly to make code C23
conformant.

Closes lxde#106 .
ib pushed a commit that referenced this issue Jan 14, 2025
C23 now regards function declaration without a parameter list
as that with no parameter (i.e. having `(void)`).

Specify parameter list explicitly to make code C23
conformant.

Closes #106 .
@ib ib closed this as completed in #107 Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant