avro-c: fix error with gcc-15
PATCH 1/1 avro-c: fix error with gcc-15
From: "mark.yang" <[email protected]>
* backport fix from:
https://github.com/apache/avro/pull/2795
https://github.com/apache/avro/pull/2798
to fix:
http://errors.yoctoproject.org/Errors/Details/851184/TOPDIR/tmp/work/core2-64-oe-linux/avro-c/1.11.3/git/lang/c/src/st.c:442:46: warning: passing argument 2 of 'st_foreach' from incompatible pointer type [-Wincompatible-pointer-types]
442 | st_foreach(table, HASH_FUNCTION_CAST delete_never, never);
| ^~~~~~~~~~~~
| |
| int (*)(st_data_t, st_data_t, st_data_t) {aka int (*)(long unsigned int, long unsigned int, long unsigned int)}Signed-off-by mark.yang <[email protected]>
--- ...-Fix-typos-in-docs-and-examples-2795.patch | 59 +++ ...O-3960-C-Fix-st-ANYARGS-warning-2798.patch | 386 ++++++++++++++++++ meta-oe/recipes-support/avro/avro-c_1.11.3.bb | 16 +- 3 files changed, 451 insertions(+), 10 deletions(-) create mode 100644 meta-oe/recipes-support/avro/avro-c/0001-AVRO-3957-C-Fix-typos-in-docs-and-examples-2795.patch create mode 100644 meta-oe/recipes-support/avro/avro-c/0001-AVRO-3960-C-Fix-st-ANYARGS-warning-2798.patch
meta-oe/recipes-support/avro/avro-c/0001-AVRO-3957-C-Fix-typos-in-docs-and-examples-2795.patch new file +59 -0
@@ -0,0 +1,59 @@ +From 52f051dbeefad0b7e73187becad6c33747b047d3 Mon Sep 17 00:00:00 2001 +From: Sahil Kang <[email protected]> +Date: Mon, 11 Mar 2024 03:01:21 -0700 +Subject: [PATCH] AVRO-3957: [C] Fix typos in docs and examples (#2795) + +* AVRO-3957: [C] Fix misformatted type in docs + +Signed-off-by: Sahil Kang <[email protected]> +Signed-off-by: Sahil Kang <[email protected]> + +* AVRO-3957: [C] Fix type in quickstop example + +This removes the following warning: + + avro/lang/c/examples/quickstop.c:123:40: warning: incompatible pointer types passing 'int32_t **' (aka 'int **') to parameter of type + 'const char **' [-Wincompatible-pointer-types] + avro_value_get_string(&first_value, &p, &size); + +Signed-off-by: Sahil Kang <[email protected]> +Signed-off-by: Sahil Kang <[email protected]> + +--------- + +Signed-off-by: Sahil Kang <[email protected]> +Signed-off-by: Sahil Kang <[email protected]> + +Upstream-Status: Backport [52f051dbee AVRO-3957: [C] Fix typos in docs and examples (#2795)] +Signed-off-by: mark.yang <[email protected]> +--- + lang/c/docs/index.txt | 2 +- + lang/c/examples/quickstop.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lang/c/docs/index.txt b/lang/c/docs/index.txt +index a439a0526..df16f9d96 100644 +--- a/lang/c/docs/index.txt ++++ b/lang/c/docs/index.txt +@@ -178,7 +178,7 @@ different versions of the Avro library. That means that it's really + only safe to use these hash values internally within the context of a + single execution of a single application. + +-The +reset+ method “clears out” an +avro_value_t instance, making sure ++The +reset+ method “clears out” an +avro_value_t+ instance, making sure + that it's ready to accept the contents of a new value. For scalars, + this is usually a no-op, since the new value will just overwrite the old + one. For arrays and maps, this removes any existing elements from the +diff --git a/lang/c/examples/quickstop.c b/lang/c/examples/quickstop.c +index ff9e97005..b26dad10c 100644 +--- a/lang/c/examples/quickstop.c ++++ b/lang/c/examples/quickstop.c +@@ -107,7 +107,7 @@ int print_person(avro_file_reader_t db, avro_schema_t reader_schema) + if (rval == 0) { + int64_t id; + int32_t age; +- int32_t *p; ++ const char *p; + size_t size; + avro_value_t id_value; + avro_value_t first_value;
meta-oe/recipes-support/avro/avro-c/0001-AVRO-3960-C-Fix-st-ANYARGS-warning-2798.patch new file +386 -0
386 lines not on this page · raw message
meta-oe/recipes-support/avro/avro-c_1.11.3.bb +6 -10
@@ -8,16 +8,12 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=6d502b41f76179fc84e536236f359cae" DEPENDS = "jansson zlib xz" BRANCH = "branch-1.11" -SRCREV = "35ff8b997738e4d983871902d47bfb67b3250734" -SRC_URI = "git://github.com/apache/avro;branch=${BRANCH};protocol=https \ - " - +SRCREV = "579a36762293fa4c9f2831e27e7af7713a0838a0" +SRC_URI = " \ + git://github.com/apache/avro;branch=${BRANCH};protocol=https \ + file://0001-AVRO-3960-C-Fix-st-ANYARGS-warning-2798.patch;patchdir=../.. \ + file://0001-AVRO-3957-C-Fix-typos-in-docs-and-examples-2795.patch;patchdir=../.. \ +" S = "${WORKDIR}/git/lang/c" inherit cmake pkgconfig - -# http://errors.yoctoproject.org/Errors/Details/766902/ -# avro-c/1.11.3/git/lang/c/examples/quickstop.c:123:61: error: passing argument 3 of 'first_value.iface->get_string' from incompatible pointer type [-Wincompatible-pointer-types] -# avro-c/1.11.3/git/lang/c/examples/quickstop.c:127:60: error: passing argument 3 of 'last_value.iface->get_string' from incompatible pointer type [-Wincompatible-pointer-types] -# avro-c/1.11.3/git/lang/c/examples/quickstop.c:131:61: error: passing argument 3 of 'phone_value.iface->get_string' from incompatible pointer type [-Wincompatible-pointer-types] -CFLAGS += "-Wno-error=incompatible-pointer-types"