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; 3+ 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] 3+ 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
  0 siblings, 1 reply; 3+ 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] 3+ 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
  0 siblings, 0 replies; 3+ 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] 3+ messages in thread

end of thread, other threads:[~2026-05-31 12:10 UTC | newest]

Thread overview: 3+ 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

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