Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/szip: fix build with GCC 15
@ 2026-02-18  7:39 Rick
  2026-02-20 11:51 ` [Buildroot] [PATCH v2] " Shubham Chakraborty
  0 siblings, 1 reply; 5+ messages in thread
From: Rick @ 2026-02-18  7:39 UTC (permalink / raw)
  To: buildroot; +Cc: Rick

GCC 15 defaults to C23, which no longer allows empty parameter lists ()
in function pointer declarations. Add explicit parameter types to
winner_function and winner_ref_function in src/rice.c.

Signed-off-by: Rick <chakrabortyshubham66@gmail.com>
---
 package/szip/0001-fix-gcc15-prototypes.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 package/szip/0001-fix-gcc15-prototypes.patch

diff --git a/package/szip/0001-fix-gcc15-prototypes.patch b/package/szip/0001-fix-gcc15-prototypes.patch
new file mode 100644
index 0000000000..77bb110734
--- /dev/null
+++ b/package/szip/0001-fix-gcc15-prototypes.patch
@@ -0,0 +1,13 @@
+--- a/src/rice.c
++++ b/src/rice.c
+@@ -103,8 +103,8 @@
+ #endif /* !HDF */
+ 
+ #ifndef REMOVE_SZIP_ENCODER
+-static int (*winner_function)();
+-static int (*winner_ref_function)();
++static int (*winner_function)(unsigned *sigma, unsigned *end);
++static int (*winner_ref_function)(unsigned *sigma, unsigned *end);
+ #endif /* !defined(REMOVE_SZIP_ENCODER) */
+ 
+ static boolean compress_exactly_as_chip;
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v2] package/szip: fix build with GCC 15
  2026-02-18  7:39 [Buildroot] [PATCH] package/szip: fix build with GCC 15 Rick
@ 2026-02-20 11:51 ` Shubham Chakraborty
  2026-05-31 12:10   ` Thomas Petazzoni via buildroot
  2026-08-10 18:14   ` Shubham Chakraborty
  0 siblings, 2 replies; 5+ messages in thread
From: Shubham Chakraborty @ 2026-02-20 11:51 UTC (permalink / raw)
  To: buildroot; +Cc: Ernesto L . Williams Jr, Shubham Chakraborty

GCC 15 defaults to C23, which no longer allows empty parameter lists
in function pointer declarations or old-style K&R function definitions.
Modernize all affected declarations in src/rice.c and src/sz_api.c.

Tested with musl toolchain and verified across 32 toolchain
configurations using test-pkg.

Signed-off-by: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
---
Changes v1 -> v2:
  - Fix Signed-off-by name (was "Rick", now correct)
  - Extend fix to cover all K&R style function definitions in rice.c
    and sz_api.c, not just winner_function pointers
  - Add proper patch headers (Signed-off-by, Upstream)
  - Tested across 32 toolchains with test-pkg, all OK
---
 ...-error-by-modernizing-C-declarations.patch | 92 +++++++++++++++++++
 1 file changed, 92 insertions(+)
 create mode 100644 package/szip/0001-rice-sz_api-fix-too-many-arguments-error-by-modernizing-C-declarations.patch

diff --git a/package/szip/0001-rice-sz_api-fix-too-many-arguments-error-by-modernizing-C-declarations.patch b/package/szip/0001-rice-sz_api-fix-too-many-arguments-error-by-modernizing-C-declarations.patch
new file mode 100644
index 0000000000..0f0bdbfb49
--- /dev/null
+++ b/package/szip/0001-rice-sz_api-fix-too-many-arguments-error-by-modernizing-C-declarations.patch
@@ -0,0 +1,92 @@
+diff -u -r a/src/rice.c b/src/rice.c
+--- a/src/rice.c	2017-01-25 23:36:17.000000000 +0530
++++ b/src/rice.c	2026-02-20 15:06:07.163580418 +0530
+@@ -103,8 +103,8 @@
+ #endif /* !HDF */
+ 
+ #ifndef REMOVE_SZIP_ENCODER
+-static int (*winner_function)();
+-static int (*winner_ref_function)();
++static int (*winner_function)(unsigned *, unsigned *);
++static int (*winner_ref_function)(unsigned *, unsigned *);
+ #endif /* !defined(REMOVE_SZIP_ENCODER) */
+ 
+ static boolean compress_exactly_as_chip;
+@@ -534,9 +534,7 @@
+ ---------------------------------------------------------------------------*/
+ #ifndef REMOVE_SZIP_ENCODER
+ static void
+-fix_last_scanline(byte_buffer, n)
+-unsigned char *byte_buffer;
+-int n;
++fix_last_scanline(unsigned char *byte_buffer, int n)
+ {
+     unsigned char *end;
+     unsigned char *p;
+@@ -601,7 +599,7 @@
+ 
+ #ifndef REMOVE_SZIP_ENCODER
+ static int
+-encode_scanline()
++encode_scanline(void)
+ {
+     char *bptr;
+     int del;
+@@ -3577,14 +3575,7 @@
+ * Valid bits_per_pixel are: 1-24,32,64.                         *
+ ****************************************************************/
+ long
+-compress_memory(options_mask, bits_per_pixel, pixels_per_block, pixels_per_scanline, in, pixels, out)
+-int options_mask;
+-int bits_per_pixel;
+-int pixels_per_block;
+-int pixels_per_scanline;
+-const void *in;
+-long pixels;
+-char *out;
++compress_memory(int options_mask, int bits_per_pixel, int pixels_per_block, int pixels_per_scanline, const void *in, long pixels, char *out)
+ {
+ #ifndef REMOVE_SZIP_ENCODER
+     long out_bytes;
+@@ -5484,15 +5475,7 @@
+ * Valid bits_per_pixel are: 1-24,32,64.                         *
+ ****************************************************************/
+ long
+-uncompress_memory(new_options_mask, new_bits_per_pixel, new_pixels_per_block, new_pixels_per_scanline, in, in_bytes, out, out_pixels)
+-int new_options_mask;
+-int new_bits_per_pixel;
+-int new_pixels_per_block;
+-int new_pixels_per_scanline;
+-const char *in;
+-long in_bytes;
+-void *out;
+-long out_pixels;
++uncompress_memory(int new_options_mask, int new_bits_per_pixel, int new_pixels_per_block, int new_pixels_per_scanline, const char *in, long in_bytes, void *out, long out_pixels)
+ {
+     static char *interleave_array;
+     long bytes_written;
+@@ -5796,12 +5779,7 @@
+ #endif /* !HDF */
+ 
+ int
+-check_params(bits_per_pixel, pixels_per_block, pixels_per_scanline, image_pixels, msg)
+-int bits_per_pixel;
+-int pixels_per_block;
+-int pixels_per_scanline;
+-long image_pixels;
+-char **msg;
++check_params(int bits_per_pixel, int pixels_per_block, int pixels_per_scanline, long image_pixels, char **msg)
+ {
+     if (bits_per_pixel >= 1 && bits_per_pixel <= 24)
+         ;
+diff -u -r a/src/sz_api.c b/src/sz_api.c
+--- a/src/sz_api.c	2017-01-25 22:10:25.000000000 +0530
++++ b/src/sz_api.c	2026-02-20 15:06:19.243681266 +0530
+@@ -467,6 +467,6 @@
+ }
+ 
+ int
+-SZ_encoder_enabled() {
++SZ_encoder_enabled(void) {
+     return(szip_allow_encoding);
+ }
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH v2] package/szip: fix build with GCC 15
  2026-02-20 11:51 ` [Buildroot] [PATCH v2] " Shubham Chakraborty
@ 2026-05-31 12:10   ` Thomas Petazzoni via buildroot
  2026-08-10 18:14   ` Shubham Chakraborty
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-05-31 12:10 UTC (permalink / raw)
  To: Shubham Chakraborty; +Cc: buildroot, Ernesto L . Williams Jr

On Fri, Feb 20, 2026 at 05:21:15PM +0530, Shubham Chakraborty wrote:
> GCC 15 defaults to C23, which no longer allows empty parameter lists
> in function pointer declarations or old-style K&R function definitions.
> Modernize all affected declarations in src/rice.c and src/sz_api.c.
> 
> Tested with musl toolchain and verified across 32 toolchain
> configurations using test-pkg.
> 
> Signed-off-by: Shubham Chakraborty <chakrabortyshubham66@gmail.com>

Same comments as for libmpeg2.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v2] package/szip: fix build with GCC 15
  2026-02-20 11:51 ` [Buildroot] [PATCH v2] " Shubham Chakraborty
  2026-05-31 12:10   ` Thomas Petazzoni via buildroot
@ 2026-08-10 18:14   ` Shubham Chakraborty
  2026-10-11  7:17     ` Thomas Petazzoni via buildroot
  1 sibling, 1 reply; 5+ messages in thread
From: Shubham Chakraborty @ 2026-08-10 18:14 UTC (permalink / raw)
  To: buildroot; +Cc: Shubham Chakraborty, Ernesto L. Williams Jr

GCC 15 defaults to C23, which no longer supports K&R-style empty
parameter list declarations used in szip. To avoid carrying intrusive
patches that rewrite legacy K&R-style declarations, pass -std=gnu89
to CFLAGS to restore the older compiler behavior.

This fixes identical build failures across multiple toolchain configurations,
including both static and dynamic builds across all libc implementations
(musl, glibc, uClibc).

Fixes:
 - http://autobuild.buildroot.net/results/63f/63f9317b194fd20118c9107c6ac0531bbc990023
 - http://autobuild.buildroot.net/results/257/25798dd0612a2fefaf6ab2865964b87604831e31
 - http://autobuild.buildroot.net/results/88f/88f7df044908fdad5b629303c7e8c324754336ff

Signed-off-by: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
---
Changes v1 -> v2:
  - Dropped intrusive C source patches and instead fixed the issue
    by appending -std=gnu89 to CFLAGS (Thomas).
  - Explicitly verified and noted that this fixes the GCC 15 K&R C issues
    across multiple toolchains (both static and dynamic across musl, glibc, uClibc).
  - Added Fixes tags pointing to multiple autobuilder failures.
  - Successfully tested across 32 toolchains using test-pkg.

 package/szip/szip.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/szip/szip.mk b/package/szip/szip.mk
index 869fc9c358..8b18196841 100644
--- a/package/szip/szip.mk
+++ b/package/szip/szip.mk
@@ -10,4 +10,8 @@ SZIP_LICENSE = szip license
 SZIP_LICENSE_FILES = COPYING
 SZIP_INSTALL_STAGING = YES
 
+# GCC 15 defaults to C23 which no longer allows K&R style function
+# declarations, so force it to use gnu89 standard.
+SZIP_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -std=gnu89"
+
 $(eval $(autotools-package))
-- 
2.55.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH v2] package/szip: fix build with GCC 15
  2026-08-10 18:14   ` Shubham Chakraborty
@ 2026-10-11  7:17     ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-10-11  7:17 UTC (permalink / raw)
  To: Shubham Chakraborty; +Cc: buildroot, Ernesto L. Williams Jr

On Mon, Aug 10, 2026 at 11:44:21PM +0530, Shubham Chakraborty wrote:
> GCC 15 defaults to C23, which no longer supports K&R-style empty
> parameter list declarations used in szip. To avoid carrying intrusive
> patches that rewrite legacy K&R-style declarations, pass -std=gnu89
> to CFLAGS to restore the older compiler behavior.
> 
> This fixes identical build failures across multiple toolchain configurations,
> including both static and dynamic builds across all libc implementations
> (musl, glibc, uClibc).
> 
> Fixes:
>  - http://autobuild.buildroot.net/results/63f/63f9317b194fd20118c9107c6ac0531bbc990023
>  - http://autobuild.buildroot.net/results/257/25798dd0612a2fefaf6ab2865964b87604831e31
>  - http://autobuild.buildroot.net/results/88f/88f7df044908fdad5b629303c7e8c324754336ff
> 
> Signed-off-by: Shubham Chakraborty <chakrabortyshubham66@gmail.com>

Thanks for the patch. In the end, we applied the series from Yegor,
which replaces szip (unmaintained) by libaec.

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-10-11  7:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-18  7:39 [Buildroot] [PATCH] package/szip: fix build with GCC 15 Rick
2026-02-20 11:51 ` [Buildroot] [PATCH v2] " Shubham Chakraborty
2026-05-31 12:10   ` Thomas Petazzoni via buildroot
2026-08-10 18:14   ` Shubham Chakraborty
2026-10-11  7:17     ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox