https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69226
Bug ID: 69226
Summary: Wrong __SIZE_TYPE__/__PTRDIFF_TYPE__/__WCHAR_TYPE__
for IA MCU
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: hjl.tools at gmail dot com
CC: vaalfreja at gmail dot com
Target Milestone: ---
[hjl@gnu-tools-1 gcc]$ cat /tmp/y.c
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __WCHAR_TYPE__ wchar_t;
void
foo (size_t a, ptrdiff_t b, wchar_t c)
{
__builtin_printf ("%d 0x%x, %ld\n", a, b, c);
}
[hjl@gnu-tools-1 gcc]$ ./xgcc -B./ -S -Wall /tmp/y.c
/tmp/y.c: In function ‘foo’:
/tmp/y.c:8:23: warning: format ‘%d’ expects argument of type ‘int’, but
argument 2 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
__builtin_printf ("%d 0x%x, %ld\n", a, b, c);
^
/tmp/y.c:8:28: warning: format ‘%x’ expects argument of type ‘unsigned int’,
but argument 3 has type ‘ptrdiff_t {aka long int}’ [-Wformat=]
__builtin_printf ("%d 0x%x, %ld\n", a, b, c);
^
/tmp/y.c:8:33: warning: format ‘%ld’ expects argument of type ‘long int’, but
argument 4 has type ‘wchar_t {aka int}’ [-Wformat=]
__builtin_printf ("%d 0x%x, %ld\n", a, b, c);
^
[hjl@gnu-tools-1 gcc]$ gcc -S -Wall /tmp/y.c -m32
[hjl@gnu-tools-1 gcc]$