Skip to contentSkip to conversation

dlt-daemon: fix sign-conversion warning in dlt_timer_conn_types array type

PATCH New Khem Raj 1 participant 4 messages Apr 18

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/4 dlt-daemon: fix sign-conversion warning in dlt_timer_conn_types array type

---
 .../dlt-daemon/char_conversion.patch          | 27 +++++++++++++++++++
 .../dlt-daemon/dlt-daemon_3.0.0.bb            |  1 +
 2 files changed, 28 insertions(+)
 create mode 100644 meta-oe/recipes-extended/dlt-daemon/dlt-daemon/char_conversion.patch
meta-oe/recipes-extended/dlt-daemon/dlt-daemon/char_conversion.patch new file +27 -0
new file mode 100644
index 0000000000..8d943b9764
@@ -0,0 +1,27 @@
+daemon: fix sign-conversion warning in dlt_timer_conn_types array type
+
+Change dlt_timer_conn_types from char[] to DltConnectionType[] to match
+the actual type of values stored in the array.
+
+This was silently working on arm64 because char is unsigned by default on
+that architecture, making it compatible with DltConnectionType (an unsigned
+enum). On x86_64, char is signed by default, causing an implicit signed-to-
+unsigned conversion when passing array elements to dlt_connection_create(),
+which triggered -Wsign-conversion and broke the build.
+
+The fix corrects the array's declared type to match its contents, making the
+code portable regardless of the platform's char signedness.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+--- a/src/daemon/dlt-daemon.c
++++ b/src/daemon/dlt-daemon.c
+@@ -140,7 +140,7 @@ int g_signo = 0;
+ /* used for value from conf file */
+ static int value_length = 1024;
+
+-static char dlt_timer_conn_types[DLT_TIMER_UNKNOWN + 1] = {
++static DltConnectionType dlt_timer_conn_types[DLT_TIMER_UNKNOWN + 1] = {
+     [DLT_TIMER_PACKET] = DLT_CONNECTION_ONE_S_TIMER,
+     [DLT_TIMER_ECU] = DLT_CONNECTION_SIXTY_S_TIMER,
+ #ifdef DLT_SYSTEMD_WATCHDOG_ENABLE
meta-oe/recipes-extended/dlt-daemon/dlt-daemon_3.0.0.bb +1 -0
index cbeb8c3703..6de62c2a3d 100644
@@ -25,6 +25,7 @@ SRC_URI = "git://github.com/COVESA/${BPN}.git;protocol=https;branch=master \
            file://0001-CMakeLists.txt-make-CONFIGURATION_FILES_DIR-aligned.patch \
            file://0001-warnings-Fix-clang-generated-warnings.patch \
            file://0001-dlt-daemon.c-fix-wrong-len.patch \
+           file://char_conversion.patch \
            "
 SRCREV = "f595ea29d1007ca1c3b2d1fd3a88adf7d3db6320"
 
author
#1 lore raw

PATCH 2/4 highway: Update to latest tip of trunk

This brings fixes to build with clang-22 and C23 support

---
 meta-oe/recipes-extended/highway/highway_1.3.0.bb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta-oe/recipes-extended/highway/highway_1.3.0.bb +3 -2
index d279994301..ddd684bb45 100644
@@ -2,14 +2,15 @@ SUMMARY = "Highway is a C++ library for SIMD (Single Instruction, Multiple Data)
 HOMEPAGE = "https://github.com/google/highway/"
 
 LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=2b42edef8fa55315f34f2370b4715ca9"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e583f1fc1c22da0f388b23a31df5b591"
 
 inherit cmake
 
 SRC_URI = "git://github.com/google/highway.git;protocol=https;branch=master \
            file://0001-Add-cmake-check-for-deducing-32bit-or-64bit-RISCV.patch"
 
-SRCREV = "ac0d5d297b13ab1b89f48484fc7911082d76a93f"
+SRCREV = "c34a36fb145de0a922a6e719b217033e1ff2eece"
+PV .= "+git"
 
 EXTRA_OECMAKE = "-DBUILD_TESTING=0 -DCMAKE_BUILD_TYPE=Release"
 
author
#2 lore raw

PATCH 3/4 libkcapi: disable C23 support to fix configure check

In reply to Khem Raj

Set ac_cv_prog_cc_c23=no to prevent autoconf from detecting C23 compiler support, avoiding potential build failures as the package is not yet fully ported to support C23 standard.

---
 meta-oe/recipes-crypto/libkcapi/libkcapi_1.5.0.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/recipes-crypto/libkcapi/libkcapi_1.5.0.bb +2 -0
index 7d27081964..532c9e29df 100644
@@ -9,6 +9,8 @@ SRC_URI = "git://github.com/smuellerDD/libkcapi.git;branch=master;protocol=https
 
 inherit autotools
 
+CACHED_CONFIGUREVARS += "ac_cv_prog_cc_c23=no"
+
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[testapp] = "--enable-kcapi-test,,,bash"
 PACKAGECONFIG[apps] = "--enable-kcapi-speed --enable-kcapi-hasher --enable-kcapi-rngapp --enable-kcapi-encapp --enable-kcapi-dgstapp,,,"
author
#3 lore raw

PATCH 4/4 enca: disable C23 support to fix configure check

In reply to Khem Raj

Set ac_cv_prog_cc_c23=no to prevent autoconf from detecting C23 compiler support, avoiding potential build failures as the package is not yet fully ported to support C23 standard.

---
 meta-oe/recipes-support/enca/enca_1.19.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/recipes-support/enca/enca_1.19.bb +2 -0
index 61da50ba52..395d7abe70 100644
@@ -17,4 +17,6 @@ SRC_URI[sha256sum] = "4c305cc59f3e57f2cfc150a6ac511690f43633595760e1cb266bf23362
 
 inherit autotools
 
+CACHED_CONFIGUREVARS += "ac_cv_prog_cc_c23=no"
+
 EXTRA_OECONF += "MKTEMP_PROG=mktemp"