Fix testcases for PR c/78304
The testcases as written made assumptions about size_t and long being invalid for use with "%u". We only need some invalid type, so this patch converts them to attempt a "const char *" with "%u", which should be invalid for every target. gcc/testsuite/ChangeLog: PR c/78304 * gcc.dg/format/pr78304.c: Convert argument from integral type to a pointer. * gcc.dg/format/pr78304-2.c: Likewise. From-SVN: r244502
This commit is contained in:
parent
76689ffc1e
commit
0ef1f9cd8c
|
@ -1,3 +1,10 @@
|
||||||
|
2017-01-16 David Malcolm <dmalcolm@redhat.com>
|
||||||
|
|
||||||
|
PR c/78304
|
||||||
|
* gcc.dg/format/pr78304.c: Convert argument from integral type
|
||||||
|
to a pointer.
|
||||||
|
* gcc.dg/format/pr78304-2.c: Likewise.
|
||||||
|
|
||||||
2017-01-16 Carl Love <cel@us.ibm.com>
|
2017-01-16 Carl Love <cel@us.ibm.com>
|
||||||
|
|
||||||
* gcc.target/powerpc/builtins-3.c: New vec_nabs testcase.
|
* gcc.target/powerpc/builtins-3.c: New vec_nabs testcase.
|
||||||
|
|
|
@ -5,7 +5,7 @@ extern int printf (const char *, ...);
|
||||||
|
|
||||||
# define PRIu32 "u"
|
# define PRIu32 "u"
|
||||||
|
|
||||||
void test (long size)
|
void test (const char *msg)
|
||||||
{
|
{
|
||||||
printf ("size: %" PRIu32 "\n", size); /* { dg-warning "expects argument of type" } */
|
printf ("size: %" PRIu32 "\n", msg); /* { dg-warning "expects argument of type" } */
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
void test (size_t size)
|
void test (const char *msg)
|
||||||
{
|
{
|
||||||
printf ("size: %" PRIu32 "\n", size); /* { dg-warning "expects argument of type" } */
|
printf ("size: %" PRIu32 "\n", msg); /* { dg-warning "expects argument of type" } */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue