diff options
| author | Khem Raj <khem.raj@oss.qualcomm.com> | 2026-04-16 08:36:28 -0700 |
|---|---|---|
| committer | Khem Raj <khem.raj@oss.qualcomm.com> | 2026-04-16 16:30:37 -0700 |
| commit | 515a0ba30dd1bb38db43189299a6d319b05a4864 (patch) | |
| tree | c4d47196c6dcf1cf9d8f6dab5ec686460e11b5e8 /meta-oe/recipes-support | |
| parent | d4e052c45eebe28ae90a0db121b91a3ce2e5f701 (diff) | |
| download | meta-openembedded-515a0ba30dd1bb38db43189299a6d319b05a4864.tar.gz | |
composefs: Fix incompatible pointer type qualifier mismatches
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
Diffstat (limited to 'meta-oe/recipes-support')
| -rw-r--r-- | meta-oe/recipes-support/composefs/composefs/0001-mkcomposefs-use-const-char-for-memchr-return-values.patch | 45 | ||||
| -rw-r--r-- | meta-oe/recipes-support/composefs/composefs_1.0.8.bb | 5 |
2 files changed, 48 insertions, 2 deletions
diff --git a/meta-oe/recipes-support/composefs/composefs/0001-mkcomposefs-use-const-char-for-memchr-return-values.patch b/meta-oe/recipes-support/composefs/composefs/0001-mkcomposefs-use-const-char-for-memchr-return-values.patch new file mode 100644 index 0000000000..9c45d4fcc0 --- /dev/null +++ b/meta-oe/recipes-support/composefs/composefs/0001-mkcomposefs-use-const-char-for-memchr-return-values.patch | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | From 9d82303c7a3a780d481469cd8eafa016dcbff86f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <khem.raj@oss.qualcomm.com> | ||
| 3 | Date: Thu, 16 Apr 2026 08:25:28 -0700 | ||
| 4 | Subject: [PATCH] mkcomposefs: use const char* for memchr return values | ||
| 5 | |||
| 6 | memchr returns void*, which when assigned to char* discards the | ||
| 7 | const qualifier of the input pointer. Cast to const char* to | ||
| 8 | preserve const'ness. | ||
| 9 | |||
| 10 | Fixes build with clang-22/glibc-2.43 | ||
| 11 | |||
| 12 | tools/mkcomposefs.c | ||
| 13 | ../sources/composefs-1.0.8/tools/mkcomposefs.c:413:8: error: initializing 'char *' with an expression of type 'const void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers] | ||
| 14 | 413 | char *embedded_nul_offset = memchr(line, 0, line_len); | ||
| 15 | | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 16 | 1 error generated. | ||
| 17 | |||
| 18 | Upstream-Status: Submitted [https://github.com/composefs/composefs/pull/435] | ||
| 19 | Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com> | ||
| 20 | --- | ||
| 21 | tools/mkcomposefs.c | 4 ++-- | ||
| 22 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 23 | |||
| 24 | diff --git a/tools/mkcomposefs.c b/tools/mkcomposefs.c | ||
| 25 | index 13b505d..e14d8d0 100644 | ||
| 26 | --- a/tools/mkcomposefs.c | ||
| 27 | +++ b/tools/mkcomposefs.c | ||
| 28 | @@ -63,7 +63,7 @@ static __attribute__((format(printf, 1, 2))) char *make_error(const char *fmt, . | ||
| 29 | static size_t split_at(const char **start, size_t *length, char split_char, | ||
| 30 | bool *partial) | ||
| 31 | { | ||
| 32 | - char *end = memchr(*start, split_char, *length); | ||
| 33 | + const char *end = (const char*)memchr(*start, split_char, *length); | ||
| 34 | if (end == NULL) { | ||
| 35 | size_t part_len = *length; | ||
| 36 | *start = *start + *length; | ||
| 37 | @@ -410,7 +410,7 @@ static char *tree_from_dump_line(dump_info *info, const char *line, | ||
| 38 | * We didn't document support for embedded NULs, and it only introduces | ||
| 39 | * ambiguity in parsing, so let's just reject this early on. | ||
| 40 | */ | ||
| 41 | - char *embedded_nul_offset = memchr(line, 0, line_len); | ||
| 42 | + const char *embedded_nul_offset = (const char*)memchr(line, 0, line_len); | ||
| 43 | if (embedded_nul_offset != NULL) { | ||
| 44 | size_t off = embedded_nul_offset - line; | ||
| 45 | return make_error("Invalid embedded NUL character at position %lld", | ||
diff --git a/meta-oe/recipes-support/composefs/composefs_1.0.8.bb b/meta-oe/recipes-support/composefs/composefs_1.0.8.bb index f2bae91f44..3450f9a339 100644 --- a/meta-oe/recipes-support/composefs/composefs_1.0.8.bb +++ b/meta-oe/recipes-support/composefs/composefs_1.0.8.bb | |||
| @@ -14,8 +14,9 @@ LIC_FILES_CHKSUM = "\ | |||
| 14 | " | 14 | " |
| 15 | 15 | ||
| 16 | SRCREV = "858ce1b38e1534c2602eb431124b5dca706bc746" | 16 | SRCREV = "858ce1b38e1534c2602eb431124b5dca706bc746" |
| 17 | SRC_URI = "git://github.com/containers/composefs.git;protocol=https;branch=main" | 17 | SRC_URI = "git://github.com/containers/composefs.git;protocol=https;branch=main;tag=v${PV} \ |
| 18 | 18 | file://0001-mkcomposefs-use-const-char-for-memchr-return-values.patch \ | |
| 19 | " | ||
| 19 | 20 | ||
| 20 | inherit meson | 21 | inherit meson |
| 21 | 22 | ||
