Skip to contentSkip to conversation

digitemp: fix build failure with gcc-15.0.1

PATCH New [email protected] 1 participant 1 message Apr 7, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 digitemp: fix build failure with gcc-15.0.1

From: "mark.yang" <[email protected]>

* backport fix from:
https://github.com/bcl/digitemp/commit/fa56b0f78d12f97ac44e0a367d413a9e88611d1c
to fix:
src/digitemp.c:171:6: error: conflicting types for ‘free_coupler’; have ‘void(int)’ 171 | void free_coupler( int free_only )

         |      ^~~~~~~~~~~~
   In file included from src/digitemp.c:78:
   src/digitemp.h:90:6: note: previous declaration of ‘free_coupler’ with type ‘void(void)’
      90 | void free_coupler();
         |      ^~~~~~~~~~~~
---
 .../0001-Fix-conflicting-prototype.patch      | 32 +++++++++++++++++++
 .../digitemp/digitemp_3.7.2.bb                |  5 ++-
 2 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-support/digitemp/digitemp/0001-Fix-conflicting-prototype.patch
meta-oe/recipes-support/digitemp/digitemp/0001-Fix-conflicting-prototype.patch new file +32 -0
new file mode 100644
index 0000000000..484fc1c3a2
@@ -0,0 +1,32 @@
+From fa56b0f78d12f97ac44e0a367d413a9e88611d1c Mon Sep 17 00:00:00 2001
+From: Robert Scheck <[email protected]>
+Date: Thu, 16 Jan 2025 21:24:41 +0100
+Subject: [PATCH] Fix conflicting prototype
+
+src/digitemp.c:171:6: error: conflicting types for ‘free_coupler’; have ‘void(int)’
+  171 | void free_coupler( int free_only )
+      |      ^~~~~~~~~~~~
+In file included from src/digitemp.c:78:
+src/digitemp.h:90:6: note: previous declaration of ‘free_coupler’ with type ‘void(void)’
+   90 | void free_coupler();
+      |      ^~~~~~~~~~~~
+
+Upstream-Status: Backport [https://github.com/bcl/digitemp/commit/fa56b0f78d12f97ac44e0a367d413a9e88611d1c]
+Signed-off-by: mark.yang <[email protected]>
+---
+ src/digitemp.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/digitemp.h b/src/digitemp.h
+index 06d50e9..e81a7be 100644
+--- a/src/digitemp.h
++++ b/src/digitemp.h
+@@ -87,7 +87,7 @@ struct _coupler {
+ 
+ /* Prototypes */
+ void usage();
+-void free_coupler();
++void free_coupler( int free_only );
+ float c2f( float temp );
+ int build_tf( char *time_format, char *format, int sensor, 
+               float temp_c, int humidity, unsigned char *sn );
meta-oe/recipes-support/digitemp/digitemp_3.7.2.bb +4 -1
index 6565097334..5272b8ea06 100644
@@ -4,7 +4,10 @@ DEPENDS = "libusb1"
 LICENSE = "GPL-2.0-only"
 LIC_FILES_CHKSUM = "file://COPYING;md5=44fee82a1d2ed0676cf35478283e0aa0"
 
-SRC_URI = "git://github.com/bcl/digitemp;branch=master;protocol=https"
+SRC_URI = " \
+    git://github.com/bcl/digitemp;branch=master;protocol=https \
+    file://0001-Fix-conflicting-prototype.patch \
+"
 
 SRCREV = "a162e63aad35358aab325388f3d5e88121606419"