Skip to contentSkip to conversation

include: fix mips64 build warning

U-Boot Zhi-zhou Zhang 2 participants 4 messages Sep 29, 2012 – Oct 2, 2012

lore
Share & tools
lore
#0 lore raw

fix warnings when building mips64, we define CONFIG_MIPS64 in config file. And this macro decides size_t. hashtable.c: In function 'hexport_r':
hashtable.c:495:2: warning: format '%zu' expects argument of type 'size_t', but argument 5 has type 'unsigned int' [-Wformat] hashtable.c:554:5: warning: format '%zu' expects argument of type 'size_t', but argument 2 has type 'unsigned int' [-Wformat] hashtable.c:554:5: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'unsigned int' [-Wformat] hashtable.c: In function 'himport_r':
hashtable.c:654:3: warning: format '%zu' expects argument of type 'size_t', but argument 2 has type 'unsigned int' [-Wformat]

---
 include/linux/types.h |    1 +
 1 file changed, 1 insertion(+)
include/linux/types.h +1 -0
index 1b0b4a4..33ee095 100644
@@ -4,6 +4,7 @@
 #ifdef	__KERNEL__
 #include <linux/config.h>
 #endif
+#include <config.h>
 
 #include <linux/posix_types.h>
 #include <asm/types.h>
Signature · 1 line
1.7.9.5
#1 lore raw

fix warnings when building mips64, we define CONFIG_MIPS64 in config file. And this macro decides size_t. hashtable.c: In function 'hexport_r':
hashtable.c:495:2: warning: format '%zu' expects argument of type 'size_t', but argument 5 has type 'unsigned int' [-Wformat] hashtable.c:554:5: warning: format '%zu' expects argument of type 'size_t', but argument 2 has type 'unsigned int' [-Wformat] hashtable.c:554:5: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'unsigned int' [-Wformat] hashtable.c: In function 'himport_r':
hashtable.c:654:3: warning: format '%zu' expects argument of type 'size_t', but argument 2 has type 'unsigned int' [-Wformat]

---
 include/linux/types.h |    1 +
 1 file changed, 1 insertion(+)
include/linux/types.h +1 -0
index 1b0b4a4..33ee095 100644
@@ -4,6 +4,7 @@
 #ifdef	__KERNEL__
 #include <linux/config.h>
 #endif
+#include <config.h>
 
 #include <linux/posix_types.h>
 #include <asm/types.h>
Signature · 1 line
1.7.9.5
#2 lore raw
In reply to Zhi-zhou Zhang

Hi Zhi-zhou,

2012/9/29 Zhi-zhou Zhang <[email protected]>:

Quoted 9 lines

fix warnings when building mips64, we define CONFIG_MIPS64 in config file. And this macro decides size_t. hashtable.c: In function 'hexport_r':
hashtable.c:495:2: warning: format '%zu' expects argument of type 'size_t', but argument 5 has type 'unsigned int' [-Wformat] hashtable.c:554:5: warning: format '%zu' expects argument of type 'size_t', but argument 2 has type 'unsigned int' [-Wformat] hashtable.c:554:5: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'unsigned int' [-Wformat] hashtable.c: In function 'himport_r':
hashtable.c:654:3: warning: format '%zu' expects argument of type 'size_t', but argument 2 has type 'unsigned int' [-Wformat]

thanks but I already fixed this in next branch of
git://git.denx.de/u-boot-mips.git.
I've replaced your check with "#if _MIPS_SZLONG != 64" (gcc built-in). Linux MIPS does the same.

Quoted 19 lines
---
 include/linux/types.h |    1 +
 1 file changed, 1 insertion(+)
include/linux/types.h +1 -1
index 1b0b4a4..33ee095 100644
@@ -4,6 +4,7 @@
 #ifdef __KERNEL__
 #include <linux/config.h>
 #endif
+#include <config.h>
 
 #include <linux/posix_types.h>
 #include <asm/types.h>
--

1.7.9.5

Signature · 2 lines
Best regards,
Daniel
#3 lore raw
Quoted 32 lines · Daniel Schwierzeck

Hi Zhi-zhou,

2012/9/29 Zhi-zhou Zhang <[email protected]>:

Quoted 9 lines

fix warnings when building mips64, we define CONFIG_MIPS64 in config file. And this macro decides size_t. hashtable.c: In function 'hexport_r':
hashtable.c:495:2: warning: format '%zu' expects argument of type 'size_t', but argument 5 has type 'unsigned int' [-Wformat] hashtable.c:554:5: warning: format '%zu' expects argument of type 'size_t', but argument 2 has type 'unsigned int' [-Wformat] hashtable.c:554:5: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'unsigned int' [-Wformat] hashtable.c: In function 'himport_r':
hashtable.c:654:3: warning: format '%zu' expects argument of type 'size_t', but argument 2 has type 'unsigned int' [-Wformat]

thanks but I already fixed this in next branch of
git://git.denx.de/u-boot-mips.git.
I've replaced your check with "#if _MIPS_SZLONG != 64" (gcc built-in). Linux MIPS does the same.

Quoted 14 lines
---
 include/linux/types.h |    1 +
 1 file changed, 1 insertion(+)
include/linux/types.h +1 -0
index 1b0b4a4..33ee095 100644
@@ -4,6 +4,7 @@
 #ifdef __KERNEL__
 #include <linux/config.h>
 #endif
+#include <config.h>
 
Quoted 9 lines
Quoted 5 lines
include/linux/types.h +0 -1
 #include <linux/posix_types.h>
 #include <asm/types.h>
--

1.7.9.5

--
Best regards,
Daniel

That's fine, thanks.

Signature · 2 lines
Regards,
Zhizhou Zhang