All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] exfatprogs: fix more 64-bit types printf compile failure
@ 2020-05-09 21:33 Peter Seiderer
  2020-05-15 21:06 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Seiderer @ 2020-05-09 21:33 UTC (permalink / raw)
  To: buildroot

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH v2] exfatprogs: fix more 64-bit types printf compile failure
  2020-05-09 21:33 [Buildroot] [PATCH v2] exfatprogs: fix more 64-bit types printf compile failure Peter Seiderer
@ 2020-05-15 21:06 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2020-05-15 21:06 UTC (permalink / raw)
  To: buildroot

On Sat,  9 May 2020 23:33:19 +0200
Peter Seiderer <ps.report@gmx.net> wrote:

> 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

I think this patch was applied upstream, released as part of version
1.0.3, which we now use in Buildroot master. So I've marked this patch
as Not Applicable.

Of course, if I missed something, let me know!

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-15 21:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-09 21:33 [Buildroot] [PATCH v2] exfatprogs: fix more 64-bit types printf compile failure Peter Seiderer
2020-05-15 21:06 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.