[openwrt/openwrt] apk-tools: fix compilation warning from downstream full print patch

LEDE Commits lede-commits at lists.infradead.org
Tue Oct 14 08:17:36 PDT 2025


ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/e408030cecdf1725060aae988915f91ff631260e

commit e408030cecdf1725060aae988915f91ff631260e
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Tue Oct 14 17:15:07 2025 +0200

    apk-tools: fix compilation warning from downstream full print patch
    
    Fix trivial compilation warning caused by downstream full print patch.
    
    ../src/app_list.c: In function 'print_full':
    ../src/app_list.c:85:35: warning: format '%zu' expects argument of type 'size_t', but argument 2 has type 'uint64_t' {aka 'long long unsigned int'} [-Wformat=]
       85 |         printf("Installed-Size: %zu\n", pkg->installed_size);
          |                                 ~~^     ~~~~~~~~~~~~~~~~~~~
          |                                   |        |
          |                                   |        uint64_t {aka long long unsigned int}
          |                                   unsigned int
          |                                 %llu
    ../src/app_list.c:86:25: warning: format '%zu' expects argument of type 'size_t', but argument 2 has type 'uint64_t' {aka 'long long unsigned int'} [-Wformat=]
       86 |         printf("Size: %zu\n", pkg->size);
          |                       ~~^     ~~~~~~~~~
          |                         |        |
          |                         |        uint64_t {aka long long unsigned int}
          |                         unsigned int
          |                       %llu
    ../src/app_list.c:58:31: warning: unused variable 'd' [-Wunused-variable]
       58 |         struct apk_dependency d;
    
    Remove unused variable and use PRIu64 to handle uint64_t type.
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 .../0001-openwrt-move-layer-db-to-temp-folder.patch        |  2 +-
 .../system/apk/patches/0010-app_list-add-full-print.patch  | 14 ++++++--------
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/package/system/apk/patches/0001-openwrt-move-layer-db-to-temp-folder.patch b/package/system/apk/patches/0001-openwrt-move-layer-db-to-temp-folder.patch
index eaeb36d10a..62c3d56453 100644
--- a/package/system/apk/patches/0001-openwrt-move-layer-db-to-temp-folder.patch
+++ b/package/system/apk/patches/0001-openwrt-move-layer-db-to-temp-folder.patch
@@ -10,7 +10,7 @@ Signed-off-by: Paul Spooren <mail at aparcar.org>
 
 --- a/src/database.c
 +++ b/src/database.c
-@@ -1832,7 +1832,7 @@ const char *apk_db_layer_name(int layer)
+@@ -1856,7 +1856,7 @@ const char *apk_db_layer_name(int layer)
  {
  	switch (layer) {
  	case APK_DB_LAYER_ROOT: return "lib/apk/db";
diff --git a/package/system/apk/patches/0010-app_list-add-full-print.patch b/package/system/apk/patches/0010-app_list-add-full-print.patch
index 13a7663f2d..f060931ef7 100644
--- a/package/system/apk/patches/0010-app_list-add-full-print.patch
+++ b/package/system/apk/patches/0010-app_list-add-full-print.patch
@@ -12,7 +12,7 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 
 --- a/src/app_list.c
 +++ b/src/app_list.c
-@@ -49,12 +49,53 @@ struct list_ctx {
+@@ -49,12 +49,51 @@ struct list_ctx {
  	unsigned int match_providers : 1;
  	unsigned int match_depends : 1;
  	unsigned int manifest : 1;
@@ -22,8 +22,6 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
  
 +static void print_full(const struct apk_package *pkg, const struct list_ctx *ctx)
 +{
-+	struct apk_dependency d;
-+
 +	printf("Package: %s\n", pkg->name->name);
 +	printf("Version: " BLOB_FMT "\n", BLOB_PRINTF(*pkg->version));
 +	if (apk_array_len(pkg->depends)) {
@@ -49,8 +47,8 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
 +	if (pkg->description)
 +		printf("Description: " BLOB_FMT "\n", BLOB_PRINTF(*pkg->description));
 +	printf("License: " BLOB_FMT "\n", BLOB_PRINTF(*pkg->license));
-+	printf("Installed-Size: %zu\n", pkg->installed_size);
-+	printf("Size: %zu\n", pkg->size);
++	printf("Installed-Size: %" PRIu64 "\n", pkg->installed_size);
++	printf("Size: %" PRIu64 "\n", pkg->size);
 +	printf("\n");
 +}
 +
@@ -66,7 +64,7 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
  	if (ctx->manifest) {
  		printf("%s " BLOB_FMT "\n", pkg->name->name, BLOB_PRINTF(*pkg->version));
  		return;
-@@ -96,6 +137,7 @@ static void print_package(const struct apk_database *db, const struct apk_name *
+@@ -96,6 +135,7 @@ static void print_package(const struct a
  	OPT(OPT_LIST_depends,		APK_OPT_SH("d") "depends") \
  	OPT(OPT_LIST_installed,		APK_OPT_SH("I")) \
  	OPT(OPT_LIST_manifest,		"manifest") \
@@ -74,7 +72,7 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
  	OPT(OPT_LIST_origin,		APK_OPT_SH("o") "origin") \
  	OPT(OPT_LIST_orphaned,		APK_OPT_SH("O")) \
  	OPT(OPT_LIST_providers,		APK_OPT_SH("P") "providers") \
-@@ -109,6 +151,9 @@ static int list_parse_option(void *pctx, struct apk_ctx *ac, int opt, const char
+@@ -109,6 +149,9 @@ static int list_parse_option(void *pctx,
  	struct apk_query_spec *qs = &ac->query;
  
  	switch (opt) {
@@ -84,7 +82,7 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
  	case OPT_LIST_available:
  		qs->filter.available = 1;
  		break;
-@@ -117,6 +162,7 @@ static int list_parse_option(void *pctx, struct apk_ctx *ac, int opt, const char
+@@ -117,6 +160,7 @@ static int list_parse_option(void *pctx,
  		break;
  	case OPT_LIST_installed:
  	installed:




More information about the lede-commits mailing list