From: Peter Seiderer <ps.report@gmx.net>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2] exfatprogs: fix more 64-bit types printf compile failure
Date: Sat, 9 May 2020 23:33:19 +0200 [thread overview]
Message-ID: <20200509213319.21792-1-ps.report@gmx.net> (raw)
Fixes test-pkg detected compile failures for the following toolchains:
- br-mips64-n64-full
- br-mips64r6-el-hf-glibc
- br-powerpc64le-power8-glibc
- br-powerpc64-power7-glibc
- sourcery-mips64
Used test config:
BR2_USE_WCHAR=y
BR2_PACKAGE_EXFATPROGS=y
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Changes v1 -> v2:
- reworked patch to don't break the other toolchains
---
...PRIu64-PRIx64-to-printf-64-bit-types.patch | 83 +++++++++++++++++++
1 file changed, 83 insertions(+)
create mode 100644 package/exfatprogs/0005-fsck-use-PRIu64-PRIx64-to-printf-64-bit-types.patch
diff --git a/package/exfatprogs/0005-fsck-use-PRIu64-PRIx64-to-printf-64-bit-types.patch b/package/exfatprogs/0005-fsck-use-PRIu64-PRIx64-to-printf-64-bit-types.patch
new file mode 100644
index 0000000000..e048722f03
--- /dev/null
+++ b/package/exfatprogs/0005-fsck-use-PRIu64-PRIx64-to-printf-64-bit-types.patch
@@ -0,0 +1,83 @@
+From fb8b321c1468a76faf5cdef94d122cb916aa6ca3 Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Sat, 9 May 2020 18:06:52 +0200
+Subject: [PATCH] fsck: use PRIu64/PRIx64 to printf 64-bit types
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes:
+
+ fsck.c:725:13: error: format ?%llu? expects argument of type ?long long unsigned int?, but argument 2 has type ?__u64 {aka long unsigned int}? [-Werror=format=]
+ exfat_err("size %llu is greater than cluster heap: %s\n",
+ ^
+
+ fsck.c:740:13: error: format ?%llu? expects argument of type ?long long unsigned int?, but argument 2 has type ?__u64 {aka long unsigned int}? [-Werror=format=]
+ exfat_err("directory size %llu is not divisible by %d: %s\n",
+ ^
+
+ fsck.c:853:13: error: format ?%llu? expects argument of type ?long long unsigned int?, but argument 3 has type ?__u64 {aka long unsigned int}? [-Werror=format=]
+ exfat_err("valid size %" PRIu64 " greater than size %llu: %s\n",
+ ^
+
+ fsck.c:1181:14: error: format ?%llx? expects argument of type ?long long unsigned int?, but argument 3 has type ?__u64 {aka long unsigned int}? [-Werror=format=]
+ exfat_debug("root directory: start cluster[0x%x] size[0x%llx]\n",
+ ^
+
+[Upstream: https://github.com/exfatprogs/exfatprogs/pull/91]
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+ fsck/fsck.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/fsck/fsck.c b/fsck/fsck.c
+index f0daa1d..ada477e 100644
+--- a/fsck/fsck.c
++++ b/fsck/fsck.c
+@@ -722,8 +722,8 @@ static bool check_inode(struct exfat *exfat, struct exfat_inode *parent,
+ if (node->size > le32_to_cpu(exfat->bs->bsx.clu_count) *
+ EXFAT_CLUSTER_SIZE(exfat->bs)) {
+ resolve_path_parent(&path_resolve_ctx, parent, node);
+- exfat_err("size %llu is greater than cluster heap: %s\n",
+- node->size, path_resolve_ctx.local_path);
++ exfat_err("size %" PRIu64 " is greater than cluster heap: %s\n",
++ (uint64_t)node->size, path_resolve_ctx.local_path);
+ ret = false;
+ }
+
+@@ -737,8 +737,8 @@ static bool check_inode(struct exfat *exfat, struct exfat_inode *parent,
+ if ((node->attr & ATTR_SUBDIR) &&
+ node->size % EXFAT_CLUSTER_SIZE(exfat->bs) != 0) {
+ resolve_path_parent(&path_resolve_ctx, parent, node);
+- exfat_err("directory size %llu is not divisible by %d: %s\n",
+- node->size, EXFAT_CLUSTER_SIZE(exfat->bs),
++ exfat_err("directory size %" PRIu64 " is not divisible by %d: %s\n",
++ (uint64_t)node->size, EXFAT_CLUSTER_SIZE(exfat->bs),
+ path_resolve_ctx.local_path);
+ ret = false;
+ }
+@@ -850,8 +850,8 @@ static int read_file_dentries(struct exfat_de_iter *iter,
+
+ if (le64_to_cpu(stream_de->stream_valid_size) > node->size) {
+ resolve_path_parent(&path_resolve_ctx, iter->parent, node);
+- exfat_err("valid size %" PRIu64 " greater than size %llu: %s\n",
+- le64_to_cpu(stream_de->stream_valid_size), node->size,
++ exfat_err("valid size %" PRIu64 " greater than size %" PRIu64 ": %s\n",
++ le64_to_cpu(stream_de->stream_valid_size), (uint64_t)node->size,
+ path_resolve_ctx.local_path);
+ ret = -EINVAL;
+ goto err;
+@@ -1178,8 +1178,8 @@ static bool exfat_root_dir_check(struct exfat *exfat)
+ root->size = clus_count * EXFAT_CLUSTER_SIZE(exfat->bs);
+
+ exfat->root = root;
+- exfat_debug("root directory: start cluster[0x%x] size[0x%llx]\n",
+- root->first_clus, root->size);
++ exfat_debug("root directory: start cluster[0x%x] size[0x%" PRIx64 "]\n",
++ root->first_clus, (uint64_t)root->size);
+ return true;
+ err:
+ free_exfat_inode(root);
+--
+2.26.2
+
--
2.26.2
next reply other threads:[~2020-05-09 21:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-09 21:33 Peter Seiderer [this message]
2020-05-15 21:06 ` [Buildroot] [PATCH v2] exfatprogs: fix more 64-bit types printf compile failure Thomas Petazzoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200509213319.21792-1-ps.report@gmx.net \
--to=ps.report@gmx.net \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox