This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[bfin] Fix SIZE_TYPE for bfin port


Mike Frysinger reported the following on blackfin.uclinux.org:

===============================
simple code:

$ cat test.c
#include <stdio.h>
#include <stdlib.h>
int main()
{
       ssize_t ss;
       printf("%zi\n", ss);
       return 0;
}

$ bfin-uclinux-gcc -Wall -c test.c
test.c: In function `main':
test.c:6: warning: signed size_t format, ssize_t arg (arg 2)

tried with x86 and amd64 compilers and neither gave me warnings
===============================

This patch seems fix it by changing the definition of SIZE_TYPE from
"long unsigned int" to "unsigned int".

Is it OK?

Thanks,
Jie
	* config/bfin/bfin.h (SIZE_TYPE): Redefine to "unsigned int".

Index: config/bfin/bfin.h
===================================================================
--- config/bfin/bfin.h	(revision 114268)
+++ config/bfin/bfin.h	(working copy)
@@ -825,7 +825,7 @@
 
 
 /* what is the 'type' of size_t */
-#define SIZE_TYPE "long unsigned int"
+#define SIZE_TYPE "unsigned int"
 
 /* Define this as 1 if `char' should by default be signed; else as 0.  */
 #define DEFAULT_SIGNED_CHAR 1



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]