All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v1 1/4] exfatprogs: fix 64-bit types printf compile failure
@ 2020-05-09 16:21 Peter Seiderer
  2020-05-09 16:21 ` [Buildroot] [PATCH v1 2/4] package/exfatprogs: fix compile failure node may be used uninitialized Peter Seiderer
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Peter Seiderer @ 2020-05-09 16:21 UTC (permalink / raw)
  To: buildroot

Fixes:

  - http://autobuild.buildroot.net/results/a7364a6b3801d7d18c30c7242c6faf19431fddfd

  mkfs.c:60:14: error: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type 'long unsigned int' [-Werror=format=]
    exfat_debug("Volume Length(sectors) : %llu\n",
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
 ...PRIu64-PRIx64-to-printf-64-bit-types.patch | 144 ++++++++++++++++++
 1 file changed, 144 insertions(+)
 create mode 100644 package/exfatprogs/0002-mkfs-fsck-use-PRIu64-PRIx64-to-printf-64-bit-types.patch

diff --git a/package/exfatprogs/0002-mkfs-fsck-use-PRIu64-PRIx64-to-printf-64-bit-types.patch b/package/exfatprogs/0002-mkfs-fsck-use-PRIu64-PRIx64-to-printf-64-bit-types.patch
new file mode 100644
index 0000000000..67dcc070ec
--- /dev/null
+++ b/package/exfatprogs/0002-mkfs-fsck-use-PRIu64-PRIx64-to-printf-64-bit-types.patch
@@ -0,0 +1,144 @@
+From fb96662501a13c7a82304b2c145146c4a8741bf8 Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Sat, 9 May 2020 13:43:37 +0200
+Subject: [PATCH] mkfs/fsck: use PRIu64/PRIx64 to print 64-bit types
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Change cpu_to_le64()/cpu_to_le32()/cpu_to_le16() defines to
+return determined types (instead of __le64/__le32/__le16) and
+use PRIu64/PRIx64 to print 64-bit types.
+
+Fixes:
+
+  mkfs.c:60:14: error: format ?%llu? expects argument of type ?long long unsigned int?, but argument 2 has type ?long unsigned int? [-Werror=format=]
+    exfat_debug("Volume Length(sectors) : %llu\n",
+                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+  fsck.c:484:13: error: format ?%llu? expects argument of type ?long long unsigned int?, but argument 2 has type ?long unsigned int? [-Werror=format=]
+     exfat_err("too large sector count: %llu\n, expected: %llu\n",
+               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+  fsck.c:851:13: error: format ?%llu? expects argument of type ?long long unsigned int?, but argument 2 has type ?long unsigned int? [-Werror=format=]
+     exfat_err("valid size %llu greater than size %llu: %s\n",
+               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+  fsck.c:930:14: error: format ?%llx? expects argument of type ?long long unsigned int?, but argument 3 has type ?long unsigned int? [-Werror=format=]
+     exfat_debug("start cluster %#x, size %#llx\n",
+                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+  fsck.c:938:13: error: format ?%llx? expects argument of type ?long long unsigned int?, but argument 2 has type ?long unsigned int? [-Werror=format=]
+     exfat_err("invalid size of allocation bitmap. 0x%llx\n",
+               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+  fsck.c:992:13: error: format ?%llx? expects argument of type ?long long unsigned int?, but argument 2 has type ?long unsigned int? [-Werror=format=]
+     exfat_err("invalid size of upcase table. 0x%llx\n",
+               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+[Upstream: https://github.com/exfatprogs/exfatprogs/pull/91]
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+ fsck/fsck.c            | 11 ++++++-----
+ include/exfat_ondisk.h |  6 +++---
+ mkfs/mkfs.c            |  3 ++-
+ 3 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/fsck/fsck.c b/fsck/fsck.c
+index 9e04407..6b48a17 100644
+--- a/fsck/fsck.c
++++ b/fsck/fsck.c
+@@ -8,6 +8,7 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <getopt.h>
++#include <inttypes.h>
+ #include <string.h>
+ #include <errno.h>
+ #include <locale.h>
+@@ -481,7 +482,7 @@ static bool exfat_boot_region_check(struct exfat *exfat)
+ 
+ 	if (le64_to_cpu(bs->bsx.vol_length) * EXFAT_SECTOR_SIZE(bs) >
+ 			exfat->blk_dev->size) {
+-		exfat_err("too large sector count: %llu\n, expected: %llu\n",
++		exfat_err("too large sector count: %" PRIu64 "\n, expected: %llu\n",
+ 				le64_to_cpu(bs->bsx.vol_length),
+ 				exfat->blk_dev->num_sectors);
+ 		goto err;
+@@ -848,7 +849,7 @@ 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 %llu greater than size %llu: %s\n",
++		exfat_err("valid size %" PRIu64 " greater than size %llu: %s\n",
+ 			le64_to_cpu(stream_de->stream_valid_size), node->size,
+ 			path_resolve_ctx.local_path);
+ 		goto err;
+@@ -927,7 +928,7 @@ static bool read_alloc_bitmap(struct exfat_de_iter *iter)
+ 	if (exfat_de_iter_get(iter, 0, &dentry))
+ 		return false;
+ 
+-	exfat_debug("start cluster %#x, size %#llx\n",
++	exfat_debug("start cluster %#x, size %#" PRIx64 "\n",
+ 			le32_to_cpu(dentry->bitmap_start_clu),
+ 			le64_to_cpu(dentry->bitmap_size));
+ 
+@@ -935,7 +936,7 @@ static bool read_alloc_bitmap(struct exfat_de_iter *iter)
+ 
+ 	if (le64_to_cpu(dentry->bitmap_size) <
+ 			DIV_ROUND_UP(exfat->bit_count, 8)) {
+-		exfat_err("invalid size of allocation bitmap. 0x%llx\n",
++		exfat_err("invalid size of allocation bitmap. 0x%" PRIx64 "\n",
+ 				le64_to_cpu(dentry->bitmap_size));
+ 		return false;
+ 	}
+@@ -989,7 +990,7 @@ static bool read_upcase_table(struct exfat_de_iter *iter)
+ 	size = (size_t)le64_to_cpu(dentry->upcase_size);
+ 	if (size > EXFAT_MAX_UPCASE_CHARS * sizeof(__le16) ||
+ 			size == 0 || size % sizeof(__le16)) {
+-		exfat_err("invalid size of upcase table. 0x%llx\n",
++		exfat_err("invalid size of upcase table. 0x%" PRIx64 "\n",
+ 			le64_to_cpu(dentry->upcase_size));
+ 		return false;
+ 	}
+diff --git a/include/exfat_ondisk.h b/include/exfat_ondisk.h
+index ae2827b..70546a3 100644
+--- a/include/exfat_ondisk.h
++++ b/include/exfat_ondisk.h
+@@ -26,9 +26,9 @@
+ #define cpu_to_le64(x)	(x)
+ #endif
+ 
+-#define le64_to_cpu(x)  cpu_to_le64(x)
+-#define le32_to_cpu(x)  cpu_to_le32(x)
+-#define le16_to_cpu(x)  cpu_to_le16(x)
++#define le64_to_cpu(x)  ((uint64_t)cpu_to_le64(x))
++#define le32_to_cpu(x)  ((uint32_t)cpu_to_le32(x))
++#define le16_to_cpu(x)  ((uint16_t)cpu_to_le16(x))
+ 
+ #define PBR_SIGNATURE		0xAA55
+ 
+diff --git a/mkfs/mkfs.c b/mkfs/mkfs.c
+index 021a51a..87035ef 100644
+--- a/mkfs/mkfs.c
++++ b/mkfs/mkfs.c
+@@ -13,6 +13,7 @@
+ #include <sys/ioctl.h>
+ #include <fcntl.h>
+ #include <getopt.h>
++#include <inttypes.h>
+ #include <errno.h>
+ #include <math.h>
+ #include <locale.h>
+@@ -57,7 +58,7 @@ static void exfat_setup_boot_sector(struct pbr *ppbr,
+ 	memset(ppbr->boot_code, 0, 390);
+ 	ppbr->signature = cpu_to_le16(PBR_SIGNATURE);
+ 
+-	exfat_debug("Volume Length(sectors) : %llu\n",
++	exfat_debug("Volume Length(sectors) : %" PRIu64 "\n",
+ 		le64_to_cpu(pbsx->vol_length));
+ 	exfat_debug("FAT Offset(sector offset) : %u\n",
+ 		le32_to_cpu(pbsx->fat_offset));
+-- 
+2.26.2
+
-- 
2.26.2

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

* [Buildroot] [PATCH v1 2/4] package/exfatprogs: fix compile failure node may be used uninitialized
  2020-05-09 16:21 [Buildroot] [PATCH v1 1/4] exfatprogs: fix 64-bit types printf compile failure Peter Seiderer
@ 2020-05-09 16:21 ` Peter Seiderer
  2020-05-09 20:42   ` Thomas Petazzoni
  2020-05-09 16:21 ` [Buildroot] [PATCH v1 3/4] package/exfatprogs: fix compile failure missing braces around initializer Peter Seiderer
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Peter Seiderer @ 2020-05-09 16:21 UTC (permalink / raw)
  To: buildroot

Fixes:

  - http://autobuild.buildroot.net/results/5c5/5c5d71fde80a4f2f027085bdb0fae9fb76ab9d32

  fsck.c:1062:18: error: 'node' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       node->parent = dir;
                    ^
  fsck.c:870:22: note: 'node' was declared here
    struct exfat_inode *node;
                        ^

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
 ...k-fix-node-may-be-used-uninitialized.patch | 63 +++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 package/exfatprogs/0003-fsck-fix-node-may-be-used-uninitialized.patch

diff --git a/package/exfatprogs/0003-fsck-fix-node-may-be-used-uninitialized.patch b/package/exfatprogs/0003-fsck-fix-node-may-be-used-uninitialized.patch
new file mode 100644
index 0000000000..b62aaf3d1c
--- /dev/null
+++ b/package/exfatprogs/0003-fsck-fix-node-may-be-used-uninitialized.patch
@@ -0,0 +1,63 @@
+From 1b0a48ef0aa33a4f5b9c8d23d9f647482d0f28dd Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Sat, 9 May 2020 15:05:46 +0200
+Subject: [PATCH] fsck: fix node may be used uninitialized
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The complicated way of gcc to tell not all failure pathes
+set a return value != 0 in the calls before.
+
+Fixes:
+
+  fsck.c:1063:18: error: ?node? may be used uninitialized in this function [-Werror=maybe-uninitialized]
+       node->parent = dir;
+                    ^
+  fsck.c:871:22: note: ?node? was declared here
+    struct exfat_inode *node;
+                        ^
+[Upstream: https://github.com/exfatprogs/exfatprogs/pull/92]
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+ fsck/fsck.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/fsck/fsck.c b/fsck/fsck.c
+index 67d7946..f0daa1d 100644
+--- a/fsck/fsck.c
++++ b/fsck/fsck.c
+@@ -801,12 +801,12 @@ static int read_file_dentries(struct exfat_de_iter *iter,
+ 	ret = exfat_de_iter_get(iter, 0, &file_de);
+ 	if (ret || file_de->type != EXFAT_FILE) {
+ 		exfat_err("failed to get file dentry. %d\n", ret);
+-		return ret;
++		return -EINVAL;
+ 	}
+ 	ret = exfat_de_iter_get(iter, 1, &stream_de);
+ 	if (ret || stream_de->type != EXFAT_STREAM) {
+ 		exfat_err("failed to get stream dentry. %d\n", ret);
+-		return ret;
++		return -EINVAL;
+ 	}
+ 
+ 	*new_node = NULL;
+@@ -825,6 +825,7 @@ static int read_file_dentries(struct exfat_de_iter *iter,
+ 		ret = exfat_de_iter_get(iter, i, &name_de);
+ 		if (ret || name_de->type != EXFAT_NAME) {
+ 			exfat_err("failed to get name dentry. %d\n", ret);
++			ret = -EINVAL;
+ 			goto err;
+ 		}
+ 
+@@ -852,6 +853,7 @@ static int read_file_dentries(struct exfat_de_iter *iter,
+ 		exfat_err("valid size %" PRIu64 " greater than size %llu: %s\n",
+ 			le64_to_cpu(stream_de->stream_valid_size), node->size,
+ 			path_resolve_ctx.local_path);
++		ret = -EINVAL;
+ 		goto err;
+ 	}
+ 
+-- 
+2.26.2
+
-- 
2.26.2

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

* [Buildroot] [PATCH v1 3/4] package/exfatprogs: fix compile failure missing braces around initializer
  2020-05-09 16:21 [Buildroot] [PATCH v1 1/4] exfatprogs: fix 64-bit types printf compile failure Peter Seiderer
  2020-05-09 16:21 ` [Buildroot] [PATCH v1 2/4] package/exfatprogs: fix compile failure node may be used uninitialized Peter Seiderer
@ 2020-05-09 16:21 ` Peter Seiderer
  2020-05-09 20:42   ` Thomas Petazzoni
  2020-05-09 16:21 ` [Buildroot] [PATCH v1 4/4] exfatprogs: fix more 64-bit types printf compile failure Peter Seiderer
  2020-05-09 20:42 ` [Buildroot] [PATCH v1 1/4] exfatprogs: fix " Thomas Petazzoni
  3 siblings, 1 reply; 10+ messages in thread
From: Peter Seiderer @ 2020-05-09 16:21 UTC (permalink / raw)
  To: buildroot

Add upstream commit to fix host package compile failure.

Fixes:

  http://autobuild.buildroot.net/results/d9c5d17de03f5d0316d5f54f9cd579b79d311d03

  fsck.c:1213:9: error: missing braces around initializer [-Werror=missing-braces]
    struct fsck_user_input ui = {0,};
           ^

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
 .../0004-fsck-Zero-init-using-memset.patch    | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 package/exfatprogs/0004-fsck-Zero-init-using-memset.patch

diff --git a/package/exfatprogs/0004-fsck-Zero-init-using-memset.patch b/package/exfatprogs/0004-fsck-Zero-init-using-memset.patch
new file mode 100644
index 0000000000..0ba15149c9
--- /dev/null
+++ b/package/exfatprogs/0004-fsck-Zero-init-using-memset.patch
@@ -0,0 +1,37 @@
+From 2a60e32258e6eb34a68d29202855d98661c78abb Mon Sep 17 00:00:00 2001
+From: Luca Stefani <luca.stefani.ge1@gmail.com>
+Date: Sun, 26 Apr 2020 15:28:21 +0200
+Subject: [PATCH] fsck: Zero-init using memset
+
+* Clang 9.0 incorrectly issues the -Wmissing-braces warning
+
+[Upstream: https://github.com/exfatprogs/exfatprogs/commit/b0519f4fa7ce513d65d0f94c4d5a05be42730e7d.patch]
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+ fsck/fsck.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/fsck/fsck.c b/fsck/fsck.c
+index 6b48a17..67d7946 100644
+--- a/fsck/fsck.c
++++ b/fsck/fsck.c
+@@ -1211,11 +1211,14 @@ void exfat_show_stat(void)
+ int main(int argc, char * const argv[])
+ {
+ 	int c, ret;
+-	struct fsck_user_input ui = {0,};
+-	struct exfat_blk_dev bd = {0,};
++	struct fsck_user_input ui;
++	struct exfat_blk_dev bd;
+ 	struct exfat *exfat = NULL;
+ 	bool version_only = false;
+ 
++	memset(&ui, 0, sizeof(ui));
++	memset(&bd, 0, sizeof(bd));
++
+ 	print_level = EXFAT_ERROR;
+ 
+ 	if (!setlocale(LC_CTYPE, ""))
+-- 
+2.26.2
+
-- 
2.26.2

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

* [Buildroot] [PATCH v1 4/4] exfatprogs: fix more 64-bit types printf compile failure
  2020-05-09 16:21 [Buildroot] [PATCH v1 1/4] exfatprogs: fix 64-bit types printf compile failure Peter Seiderer
  2020-05-09 16:21 ` [Buildroot] [PATCH v1 2/4] package/exfatprogs: fix compile failure node may be used uninitialized Peter Seiderer
  2020-05-09 16:21 ` [Buildroot] [PATCH v1 3/4] package/exfatprogs: fix compile failure missing braces around initializer Peter Seiderer
@ 2020-05-09 16:21 ` Peter Seiderer
  2020-05-09 16:42   ` Peter Seiderer
  2020-05-09 20:42 ` [Buildroot] [PATCH v1 1/4] exfatprogs: fix " Thomas Petazzoni
  3 siblings, 1 reply; 10+ messages in thread
From: Peter Seiderer @ 2020-05-09 16:21 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>
---
 ...PRIu64-PRIx64-to-printf-64-bit-types.patch | 75 +++++++++++++++++++
 1 file changed, 75 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..d7e3e3c8dd
--- /dev/null
+++ b/package/exfatprogs/0005-fsck-use-PRIu64-PRIx64-to-printf-64-bit-types.patch
@@ -0,0 +1,75 @@
+From e9acfd5f7e734952c22d2a5694bf7d99e9e5837f 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 | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/fsck/fsck.c b/fsck/fsck.c
+index f0daa1d..5631dc3 100644
+--- a/fsck/fsck.c
++++ b/fsck/fsck.c
+@@ -722,7 +722,7 @@ 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",
++		exfat_err("size %" PRIu64 " is greater than cluster heap: %s\n",
+ 				node->size, path_resolve_ctx.local_path);
+ 		ret = false;
+ 	}
+@@ -737,7 +737,7 @@ 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",
++		exfat_err("directory size %" PRIu64 " is not divisible by %d: %s\n",
+ 				node->size, EXFAT_CLUSTER_SIZE(exfat->bs),
+ 				path_resolve_ctx.local_path);
+ 		ret = false;
+@@ -850,7 +850,7 @@ 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",
++		exfat_err("valid size %" PRIu64 " greater than size %" PRIu64 ": %s\n",
+ 			le64_to_cpu(stream_de->stream_valid_size), node->size,
+ 			path_resolve_ctx.local_path);
+ 		ret = -EINVAL;
+@@ -1178,7 +1178,7 @@ 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",
++	exfat_debug("root directory: start cluster[0x%x] size[0x%" PRIx64 "]\n",
+ 		root->first_clus, root->size);
+ 	return true;
+ err:
+-- 
+2.26.2
+
-- 
2.26.2

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

* [Buildroot] [PATCH v1 4/4] exfatprogs: fix more 64-bit types printf compile failure
  2020-05-09 16:21 ` [Buildroot] [PATCH v1 4/4] exfatprogs: fix more 64-bit types printf compile failure Peter Seiderer
@ 2020-05-09 16:42   ` Peter Seiderer
  2020-05-09 19:50     ` Thomas Petazzoni
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Seiderer @ 2020-05-09 16:42 UTC (permalink / raw)
  To: buildroot

On Sat,  9 May 2020 18:21:17 +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
> 

Ignore this one, breaks some other toolchains build....update follows ;-)

Regards,
Peter

> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
>  ...PRIu64-PRIx64-to-printf-64-bit-types.patch | 75 +++++++++++++++++++
>  1 file changed, 75 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..d7e3e3c8dd
> --- /dev/null
> +++ b/package/exfatprogs/0005-fsck-use-PRIu64-PRIx64-to-printf-64-bit-types.patch
> @@ -0,0 +1,75 @@
> +From e9acfd5f7e734952c22d2a5694bf7d99e9e5837f 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 | 8 ++++----
> + 1 file changed, 4 insertions(+), 4 deletions(-)
> +
> +diff --git a/fsck/fsck.c b/fsck/fsck.c
> +index f0daa1d..5631dc3 100644
> +--- a/fsck/fsck.c
> ++++ b/fsck/fsck.c
> +@@ -722,7 +722,7 @@ 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",
> ++		exfat_err("size %" PRIu64 " is greater than cluster heap: %s\n",
> + 				node->size, path_resolve_ctx.local_path);
> + 		ret = false;
> + 	}
> +@@ -737,7 +737,7 @@ 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",
> ++		exfat_err("directory size %" PRIu64 " is not divisible by %d: %s\n",
> + 				node->size, EXFAT_CLUSTER_SIZE(exfat->bs),
> + 				path_resolve_ctx.local_path);
> + 		ret = false;
> +@@ -850,7 +850,7 @@ 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",
> ++		exfat_err("valid size %" PRIu64 " greater than size %" PRIu64 ": %s\n",
> + 			le64_to_cpu(stream_de->stream_valid_size), node->size,
> + 			path_resolve_ctx.local_path);
> + 		ret = -EINVAL;
> +@@ -1178,7 +1178,7 @@ 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",
> ++	exfat_debug("root directory: start cluster[0x%x] size[0x%" PRIx64 "]\n",
> + 		root->first_clus, root->size);
> + 	return true;
> + err:
> +-- 
> +2.26.2
> +

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

* [Buildroot] [PATCH v1 4/4] exfatprogs: fix more 64-bit types printf compile failure
  2020-05-09 16:42   ` Peter Seiderer
@ 2020-05-09 19:50     ` Thomas Petazzoni
  2020-05-09 21:53       ` Peter Seiderer
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2020-05-09 19:50 UTC (permalink / raw)
  To: buildroot

On Sat, 9 May 2020 18:42:46 +0200
Peter Seiderer <ps.report@gmx.net> wrote:

> Ignore this one, breaks some other toolchains build....update follows ;-)

Also, we probably want a patch to disable -Werror, as this is always
going to cause build problems.

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

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

* [Buildroot] [PATCH v1 1/4] exfatprogs: fix 64-bit types printf compile failure
  2020-05-09 16:21 [Buildroot] [PATCH v1 1/4] exfatprogs: fix 64-bit types printf compile failure Peter Seiderer
                   ` (2 preceding siblings ...)
  2020-05-09 16:21 ` [Buildroot] [PATCH v1 4/4] exfatprogs: fix more 64-bit types printf compile failure Peter Seiderer
@ 2020-05-09 20:42 ` Thomas Petazzoni
  3 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2020-05-09 20:42 UTC (permalink / raw)
  To: buildroot

On Sat,  9 May 2020 18:21:14 +0200
Peter Seiderer <ps.report@gmx.net> wrote:

> Fixes:
> 
>   - http://autobuild.buildroot.net/results/a7364a6b3801d7d18c30c7242c6faf19431fddfd
> 
>   mkfs.c:60:14: error: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type 'long unsigned int' [-Werror=format=]
>     exfat_debug("Volume Length(sectors) : %llu\n",
>                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
>  ...PRIu64-PRIx64-to-printf-64-bit-types.patch | 144 ++++++++++++++++++
>  1 file changed, 144 insertions(+)
>  create mode 100644 package/exfatprogs/0002-mkfs-fsck-use-PRIu64-PRIx64-to-printf-64-bit-types.patch

Applied to master, thanks.

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

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

* [Buildroot] [PATCH v1 2/4] package/exfatprogs: fix compile failure node may be used uninitialized
  2020-05-09 16:21 ` [Buildroot] [PATCH v1 2/4] package/exfatprogs: fix compile failure node may be used uninitialized Peter Seiderer
@ 2020-05-09 20:42   ` Thomas Petazzoni
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2020-05-09 20:42 UTC (permalink / raw)
  To: buildroot

On Sat,  9 May 2020 18:21:15 +0200
Peter Seiderer <ps.report@gmx.net> wrote:

> Fixes:
> 
>   - http://autobuild.buildroot.net/results/5c5/5c5d71fde80a4f2f027085bdb0fae9fb76ab9d32
> 
>   fsck.c:1062:18: error: 'node' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>        node->parent = dir;
>                     ^
>   fsck.c:870:22: note: 'node' was declared here
>     struct exfat_inode *node;
>                         ^
> 
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
>  ...k-fix-node-may-be-used-uninitialized.patch | 63 +++++++++++++++++++
>  1 file changed, 63 insertions(+)
>  create mode 100644 package/exfatprogs/0003-fsck-fix-node-may-be-used-uninitialized.patch

Applied to master, thanks.

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

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

* [Buildroot] [PATCH v1 3/4] package/exfatprogs: fix compile failure missing braces around initializer
  2020-05-09 16:21 ` [Buildroot] [PATCH v1 3/4] package/exfatprogs: fix compile failure missing braces around initializer Peter Seiderer
@ 2020-05-09 20:42   ` Thomas Petazzoni
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2020-05-09 20:42 UTC (permalink / raw)
  To: buildroot

On Sat,  9 May 2020 18:21:16 +0200
Peter Seiderer <ps.report@gmx.net> wrote:

> Add upstream commit to fix host package compile failure.
> 
> Fixes:
> 
>   http://autobuild.buildroot.net/results/d9c5d17de03f5d0316d5f54f9cd579b79d311d03
> 
>   fsck.c:1213:9: error: missing braces around initializer [-Werror=missing-braces]
>     struct fsck_user_input ui = {0,};
>            ^
> 
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
>  .../0004-fsck-Zero-init-using-memset.patch    | 37 +++++++++++++++++++
>  1 file changed, 37 insertions(+)
>  create mode 100644 package/exfatprogs/0004-fsck-Zero-init-using-memset.patch

Applied to master, thanks.

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

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

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

Hello Thomas,

On Sat, 9 May 2020 21:50:59 +0200, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:

> On Sat, 9 May 2020 18:42:46 +0200
> Peter Seiderer <ps.report@gmx.net> wrote:
>
> > Ignore this one, breaks some other toolchains build....update follows ;-)
>
> Also, we probably want a patch to disable -Werror, as this is always
> going to cause build problems.

The next version of extfatprogs will already disable -Werror (see [1] and [2])...

Considered the same (specially after the printf fixing loop), but the
'node may be used uninitialized' seems a 'real' bug, so decided to
keep -Werror and to investigate/fix the errors/bugs ;-)

Regards,
Peter

[1] https://github.com/exfatprogs/exfatprogs/commit/1ed530e5e68eeaaeb0764c3831a59aacfdd7ced8
[2] https://github.com/exfatprogs/exfatprogs/commit/0fefa8a1eb92bb95be3756693b58f55af9b18bee

>
> Thomas

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

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

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-09 16:21 [Buildroot] [PATCH v1 1/4] exfatprogs: fix 64-bit types printf compile failure Peter Seiderer
2020-05-09 16:21 ` [Buildroot] [PATCH v1 2/4] package/exfatprogs: fix compile failure node may be used uninitialized Peter Seiderer
2020-05-09 20:42   ` Thomas Petazzoni
2020-05-09 16:21 ` [Buildroot] [PATCH v1 3/4] package/exfatprogs: fix compile failure missing braces around initializer Peter Seiderer
2020-05-09 20:42   ` Thomas Petazzoni
2020-05-09 16:21 ` [Buildroot] [PATCH v1 4/4] exfatprogs: fix more 64-bit types printf compile failure Peter Seiderer
2020-05-09 16:42   ` Peter Seiderer
2020-05-09 19:50     ` Thomas Petazzoni
2020-05-09 21:53       ` Peter Seiderer
2020-05-09 20:42 ` [Buildroot] [PATCH v1 1/4] exfatprogs: fix " 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.