diff options
author | Joseph Myers <jsm@polyomino.org.uk> | 2004-10-08 20:52:04 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2004-10-08 20:52:04 +0100 |
commit | 6dcc04b0603acb478023cd019af32eb5ca99e85f (patch) | |
tree | 4fa6c8af626d7dec63a89e86d8e3da6d78eff98b /gcc/testsuite/gcc.dg/assign-warn-3.c | |
parent | ba52691ca1fbf094d12590ad2fae3067a02ae36d (diff) | |
download | gcc-6dcc04b0603acb478023cd019af32eb5ca99e85f.zip gcc-6dcc04b0603acb478023cd019af32eb5ca99e85f.tar.gz gcc-6dcc04b0603acb478023cd019af32eb5ca99e85f.tar.bz2 |
c-typeck.c (enum impl_conv): Add ic_argpass_nonproto.
* c-typeck.c (enum impl_conv): Add ic_argpass_nonproto.
(convert_for_assignment): Handle ic_argpass_nonproto. Add
comments about its relevance to errors.
(c_convert_parm_for_inlining): Use ic_argpass_nonproto.
testsuite:
* gcc.dg/assign-warn-3.c: New test.
From-SVN: r88784
Diffstat (limited to 'gcc/testsuite/gcc.dg/assign-warn-3.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/assign-warn-3.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/assign-warn-3.c b/gcc/testsuite/gcc.dg/assign-warn-3.c new file mode 100644 index 0000000..1463fce --- /dev/null +++ b/gcc/testsuite/gcc.dg/assign-warn-3.c @@ -0,0 +1,13 @@ +/* Test diagnostics for bad type conversion when inlining unprototyped + functions: should not be errors with -pedantic-errors. */ +/* Origin: Joseph Myers <jsm@polyomino.org.uk> */ +/* { dg-do compile } */ +/* { dg-options "-O3 -std=c99 -pedantic-errors" } */ + +/* This is valid to execute, so maybe shouldn't warn at all. */ +void f0(x) signed char *x; { } +void g0(unsigned char *x) { f0(x); } /* { dg-warning "warning: pointer targets in passing argument 1 of 'f0' differ in signedness" } */ + +/* This is undefined on execution but still must compile. */ +void f1(x) int *x; { } +void g1(unsigned int *x) { f1(x); } /* { dg-warning "warning: pointer targets in passing argument 1 of 'f1' differ in signedness" } */ |