Skip to contentSkip to conversation

package/sane-backends: fix build with gcc >= 15.x

Buildroot Thomas Perale via buildroot 1 participant 1 message Nov 27, 2025

lore
Share & tools
lore
#0 lore raw

commit: https://git.buildroot.net/buildroot/commit/?id=a9b4636a627c546156b9a32b8523de0829d32585
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2025.08.x

Fixes:
https://autobuild.buildroot.net/results/296/2961e7aa23d66e7cf364c2caeafc1c226ccd48d9/

(cherry picked from commit 016993bd9ab334f4419cbb9b2e9c383e7554d4df)
---
 ...0002-sm3600.h-Fix-build-with-standard-C23.patch | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)
package/sane-backends/0002-sm3600.h-Fix-build-with-standard-C23.patch new file +38 -0
new file mode 100644
index 0000000000..287de48285
@@ -0,0 +1,38 @@
+From 90815a9f2576c2428287a500cab6caeddb80f9a8 Mon Sep 17 00:00:00 2001
+From: Zdenek Dohnal <[email protected]>
+Date: Wed, 5 Feb 2025 13:19:11 +0100
+Subject: [PATCH] sm3600.h: Fix build with standard C23
+
+bool, true and false are keywords in the standard C23 - the sm3600
+backend defines them on its own, which is forbidden with the new
+standard.
+
+The patch adds ifdef guards for the affected typedef - the old code
+will be used for older standards, C23 will define TBool as bool.
+
+Upstream: https://gitlab.com/sane-project/backends/-/commit/90815a9f2576c2428287a500cab6caeddb80f9a8
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ backend/sm3600.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/backend/sm3600.h b/backend/sm3600.h
+index 2ecbeb236..5d8a8d809 100644
+--- a/backend/sm3600.h
++++ b/backend/sm3600.h
+@@ -77,7 +77,11 @@ Start: 2.4.2001
+ 
+ /* ====================================================================== */
+ 
++#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L
+ typedef enum { false, true } TBool;
++#else
++typedef bool TBool;
++#endif /* GCC < 15 */
+ 
+ typedef SANE_Status TState;
+ 
+-- 
+GitLab
+

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot