[dtc] Fix type specifier error (from Dan Horák)

Josh Boyer jwboyer at fedoraproject.org
Thu Jun 6 17:52:33 UTC 2013


commit f3da2d1b00d01d83fef7001d5767baa3d5a6df87
Author: Josh Boyer <jwboyer at redhat.com>
Date:   Thu Jun 6 13:52:22 2013 -0400

    Fix type specifier error (from Dan Horák)

 dtc.spec                                         |    7 ++-
 use-tx-as-the-type-specifier-instead-of-zx.patch |   57 ++++++++++++++++++++++
 2 files changed, 63 insertions(+), 1 deletions(-)
---
diff --git a/dtc.spec b/dtc.spec
index d3c628e..24192c2 100644
--- a/dtc.spec
+++ b/dtc.spec
@@ -1,12 +1,13 @@
 Name:           dtc
 Version:        1.3.0
-Release:        7%{?dist}
+Release:        8%{?dist}
 Summary:        Device Tree Compiler
 Group:          Development/Tools
 License:        GPLv2+
 URL:            http://git.jdl.com/gitweb/?p=dtc.git;a=summary
 Source:         http://www.jdl.com/software/dtc-v%{version}.tgz
 Patch0:         dtc-update.patch
+Patch1:         use-tx-as-the-type-specifier-instead-of-zx.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  flex, bison
@@ -34,6 +35,7 @@ This package provides development files for libfdt
 %prep
 %setup -q -n dtc-v%{version}
 %patch0 -p1
+%patch1 -p1
 
 %build
 make %{?_smp_mflags}
@@ -73,6 +75,9 @@ rm -rf $RPM_BUILD_ROOT
 /sbin/ldconfig
 
 %changelog
+* Thu Jun 06 2013 Josh Boyer <jwboyer at redhat.com> - 1.3.0-8
+- Fix type specifier error (from Dan Horák)
+
 * Mon Jun 03 2013 Josh Boyer <jwboyer at redhat.com> - 1.3.0-7
 - Update dtc to include libfdt_env.h (rhbz 969955)
 
diff --git a/use-tx-as-the-type-specifier-instead-of-zx.patch b/use-tx-as-the-type-specifier-instead-of-zx.patch
new file mode 100644
index 0000000..9c31575
--- /dev/null
+++ b/use-tx-as-the-type-specifier-instead-of-zx.patch
@@ -0,0 +1,57 @@
+From 46ed9702a0005da87edd0cc3d34dbe24d1526784 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan at danny.cz>
+Date: Thu, 6 Jun 2013 17:01:39 +0200
+Subject: [PATCH] use tx as the type specifier instead of zx
+
+A couple of printf() commands use "zx" as a type specifier for printing
+a difference of 2 pointers. "z" means a size_t, but using "t" which is
+ptrdiff_t is correct. The issue was found on s390 (32-bit) where size_t
+is defined as "unsigned long" as opposed to the usual "unsigned int".
+---
+ fdtdump.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/fdtdump.c b/fdtdump.c
+index 723770d..c5811f0 100644
+--- a/fdtdump.c
++++ b/fdtdump.c
+@@ -95,7 +95,7 @@ static void dump_blob(void *blob, bool debug)
+ 	p = p_struct;
+ 	while ((tag = fdt32_to_cpu(GET_CELL(p))) != FDT_END) {
+ 
+-		dumpf("%04zx: tag: 0x%08x (%s)\n",
++		dumpf("%04tx: tag: 0x%08x (%s)\n",
+ 		        (uintptr_t)p - blob_off - 4, tag, tagname(tag));
+ 
+ 		if (tag == FDT_BEGIN_NODE) {
+@@ -135,8 +135,8 @@ static void dump_blob(void *blob, bool debug)
+ 
+ 		p = PALIGN(p + sz, 4);
+ 
+-		dumpf("%04zx: string: %s\n", (uintptr_t)s - blob_off, s);
+-		dumpf("%04zx: value\n", (uintptr_t)t - blob_off);
++		dumpf("%04tx: string: %s\n", (uintptr_t)s - blob_off, s);
++		dumpf("%04tx: value\n", (uintptr_t)t - blob_off);
+ 		printf("%*s%s", depth * shift, "", s);
+ 		utilfdt_print_data(t, sz);
+ 		printf(";\n");
+@@ -210,14 +210,14 @@ int main(int argc, char *argv[])
+ 					fdt_off_dt_strings(p) < this_len)
+ 					break;
+ 				if (debug)
+-					printf("%s: skipping fdt magic at offset %#zx\n",
++					printf("%s: skipping fdt magic at offset %#tx\n",
+ 						file, p - buf);
+ 			}
+ 			++p;
+ 		}
+ 		if (!p)
+ 			die("%s: could not locate fdt magic\n", file);
+-		printf("%s: found fdt at offset %#zx\n", file, p - buf);
++		printf("%s: found fdt at offset %#tx\n", file, p - buf);
+ 		buf = p;
+ 	}
+ 
+-- 
+1.8.1.4
+


More information about the scm-commits mailing list