[PATCH 3/4] DTC: Appease the printf() format $Gods with a correct type.

Subsystems: the rest

STALE6898d

4 messages, 3 authors, 2007-10-20 · open the first message on its own page

[PATCH 3/4] DTC: Appease the printf() format $Gods with a correct type.

From: Jon Loeliger <hidden>
Date: 2007-10-19 17:43:17

Signed-off-by: Jon Loeliger <redacted>
---
 tests/get_name.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tests/get_name.c b/tests/get_name.c
index 2481741..a76bdf8 100644
--- a/tests/get_name.c
+++ b/tests/get_name.c
@@ -55,7 +55,7 @@ void check_name(void *fdt, const char *path)
 
 	if (len != strlen(getname))
 		FAIL("fdt_get_name(%s) returned length %d instead of %d",
-		     path, len, strlen(getname));
+		     path, len, (int) strlen(getname));
 
 	/* Now check that it doesn't break if we omit len */
 	getname2 = fdt_get_name(fdt, offset, NULL);
-- 
1.5.3.1.139.g9346b

Re: [PATCH 3/4] DTC: Appease the printf() format $Gods with a correct type.

From: David Gibson <hidden>
Date: 2007-10-20 07:19:20

On Fri, Oct 19, 2007 at 12:43:13PM -0500, Jon Loeliger wrote:
Signed-off-by: Jon Loeliger <redacted>
Hrm.... I'm very dubious about this.

What compiler/platform is this?  I can't off the top of my head think
of one where size_t shouldn't be promoted to int automatically.
Or there's the %z modifier, which explicitly specifies a size_t, but
I'm not sure if that's C99 or a glibc extension.

quoted hunk
---
 tests/get_name.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tests/get_name.c b/tests/get_name.c
index 2481741..a76bdf8 100644
--- a/tests/get_name.c
+++ b/tests/get_name.c
@@ -55,7 +55,7 @@ void check_name(void *fdt, const char *path)
 
 	if (len != strlen(getname))
 		FAIL("fdt_get_name(%s) returned length %d instead of %d",
-		     path, len, strlen(getname));
+		     path, len, (int) strlen(getname));
 
 	/* Now check that it doesn't break if we omit len */
 	getname2 = fdt_get_name(fdt, offset, NULL);
-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Re: [PATCH 3/4] DTC: Appease the printf() format $Gods with a correct type.

From: Andreas Schwab <hidden>
Date: 2007-10-20 08:51:35

David Gibson [off-list ref] writes:
What compiler/platform is this?  I can't off the top of my head think
of one where size_t shouldn't be promoted to int automatically.
Only types narrower than int are subject to integer promotion.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Re: [PATCH 3/4] DTC: Appease the printf() format $Gods with a correct type.

From: David Gibson <hidden>
Date: 2007-10-20 09:06:33

On Sat, Oct 20, 2007 at 10:51:29AM +0200, Andreas Schwab wrote:
David Gibson [off-list ref] writes:
quoted
What compiler/platform is this?  I can't off the top of my head think
of one where size_t shouldn't be promoted to int automatically.
Only types narrower than int are subject to integer promotion.
Duh, yes.  Sorry.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help