Bug 281247 - sysutils/grub2-pcbsd: Fails to build with GCC 14: error: passing argument 1 of 'grub_util_check_geom_label' from incompatible pointer type [-Wincompatible-pointer-types]
Summary: sysutils/grub2-pcbsd: Fails to build with GCC 14: error: passing argument 1 o...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Lorenzo Salvadore
URL: https://pkg-status.freebsd.org/gohan0...
Keywords:
Depends on:
Blocks: 281091
  Show dependency treegraph
 
Reported: 2024-09-03 14:00 UTC by Lorenzo Salvadore
Modified: 2025-01-22 09:47 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lorenzo Salvadore freebsd_committer freebsd_triage 2024-09-03 14:00:32 UTC
Build fails with GCC 14. This blocks GCC_DEFAULT update to GCC 14.

gcc14 -DHAVE_CONFIG_H -I.  -Wall -W -DGRUB_UTIL=1 -D_FILE_OFFSET_BITS=64 -I./include -DGRUB_FILE=\"grub-core/osdep/unix/getroot.c\" -I. -I. -I. -I. -I./include -I./include -I./grub-core/lib/libgcrypt-grub/src/  -I./grub-core/gnulib -I./grub-core/gnulib -I/usr/local/include -D_FILE_OFFSET_BITS=64 -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2  -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -O2 -pipe  -Wl,-rpath=/usr/local/lib/gcc14 -fno-strict-aliasing  -MT grub-core/osdep/unix/libgrubkern_a-getroot.o -MD -MP -MF grub-core/osdep/unix/.deps-util/libgrubkern_a-getroot.Tpo -c -o grub-core/osdep/unix/libgrubkern_a-getroot.o `test -f 'grub-core/osdep/unix/getroot.c' || echo './'`grub-core/osdep/unix/getroot.c
grub-core/osdep/unix/getroot.c: In function 'grub_guess_root_devices':
grub-core/osdep/unix/getroot.c:512:37: error: passing argument 1 of 'grub_util_check_geom_label' from incompatible pointer type [-Wincompatible-pointer-types]
  512 |     if ( grub_util_check_geom_label(os_dev) )
      |                                     ^~~~~~
      |                                     |
      |                                     char **
In file included from grub-core/osdep/unix/getroot.c:73:
./include/grub/emu/getroot.h:47:44: note: expected 'const char *' but argument is of type 'char **'
   47 | int grub_util_check_geom_label(const char *name);
      |                                ~~~~~~~~~~~~^~~~
grub-core/osdep/unix/getroot.c:513:79: error: passing argument 1 of 'grub_util_convert_geom_label_to_dev' from incompatible pointer type [-Wincompatible-pointer-types]
  513 |       os_dev = grub_util_convert_geom_label_to_dev (os_dev + sizeof ("/dev/") - 1, 1);
      |                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
      |                                                                               |
      |                                                                               char **
./include/grub/emu/getroot.h:48:62: note: expected 'const char *' but argument is of type 'char **'
   48 | const char *grub_util_convert_geom_label_to_dev (const char *name, int *full_path);
      |                                                  ~~~~~~~~~~~~^~~~
grub-core/osdep/unix/getroot.c:513:84: error: passing argument 2 of 'grub_util_convert_geom_label_to_dev' makes pointer from integer without a cast [-Wint-conversion]
  513 |       os_dev = grub_util_convert_geom_label_to_dev (os_dev + sizeof ("/dev/") - 1, 1);
      |                                                                                    ^
      |                                                                                    |
      |                                                                                    int
./include/grub/emu/getroot.h:48:73: note: expected 'int *' but argument is of type 'int'
   48 | const char *grub_util_convert_geom_label_to_dev (const char *name, int *full_path);
      |                                                                    ~~~~~^~~~~~~~~
grub-core/osdep/unix/getroot.c:513:14: error: assignment to 'char **' from incompatible pointer type 'const char *' [-Wincompatible-pointer-types]
  513 |       os_dev = grub_util_convert_geom_label_to_dev (os_dev + sizeof ("/dev/") - 1, 1);
      |              ^
gmake[2]: *** [Makefile:6022: grub-core/osdep/unix/libgrubkern_a-getroot.o] Error 1
gmake[2]: Leaving directory '/wrkdirs/usr/ports/sysutils/grub2-pcbsd/work/grub-2.02'
gmake[1]: *** [Makefile:11107: all-recursive] Error 1
gmake[1]: Leaving directory '/wrkdirs/usr/ports/sysutils/grub2-pcbsd/work/grub-2.02'
gmake: *** [Makefile:3497: all] Error 2
*** Error code 1

Stop.

Full log: https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/grub2-pcbsd-2.02q_19.log

Useful link: https://gcc.gnu.org/gcc-14/porting_to.html
Comment 1 commit-hook freebsd_committer freebsd_triage 2024-09-05 15:20:36 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6acd359216c7f6877651742bf6782363f6b67782

commit 6acd359216c7f6877651742bf6782363f6b67782
Author:     Lorenzo Salvadore <salvadore@FreeBSD.org>
AuthorDate: 2024-09-05 14:58:40 +0000
Commit:     Lorenzo Salvadore <salvadore@FreeBSD.org>
CommitDate: 2024-09-05 15:19:14 +0000

    sysutils/grub2-pcbsd: Fix build with GCC 14

    GCC 14 has transformed some warnings into errors: revert them to simple
    warnings.

    PR:             281247
    Reported by:    exp-run (antoine)

 sysutils/grub2-pcbsd/Makefile | 2 ++
 1 file changed, 2 insertions(+)
Comment 2 commit-hook freebsd_committer freebsd_triage 2025-01-22 09:47:13 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a1cf722127b7f04701151a9d5992080ffc0fa44a

commit a1cf722127b7f04701151a9d5992080ffc0fa44a
Author:     Lorenzo Salvadore <salvadore@FreeBSD.org>
AuthorDate: 2025-01-22 09:32:58 +0000
Commit:     Lorenzo Salvadore <salvadore@FreeBSD.org>
CommitDate: 2025-01-22 09:46:50 +0000

    devel/gcc-arm-embedded: Set USE_GCC=13

    Does not build with GCC 14. Set USE_GCC=13 so that the port does not
    block GCC_DEFAULT update to GCC 14.

    PR:             281247

 devel/gcc-arm-embedded/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)