Testsuite changes for new -Wstrict-aliasing=2 option.
* gcc.dg/alias-1.c: Add "will" to string passed to dg-warning. * gcc.dg/alias-2.c: New testcase. From-SVN: r79223
This commit is contained in:
parent
5399d64368
commit
8a308d45d5
@ -1,3 +1,8 @@
|
||||
2004-03-09 James E Wilson <wilson@specifixinc.com>
|
||||
|
||||
* gcc.dg/alias-1.c: Add "will" to string passed to dg-warning.
|
||||
* gcc.dg/alias-2.c: New testcase.
|
||||
|
||||
2004-03-09 Zack Weinberg <zack@codesourcery.com>
|
||||
|
||||
* gcc.dg/noncompile/incomplete-2.c: Move dg-error to proper line.
|
||||
|
@ -19,7 +19,7 @@ YYSTYPE
|
||||
addSibMacro(
|
||||
YYSTYPE list )
|
||||
{
|
||||
tDefEntry** ppT = (tDefEntry**)&list; // { dg-warning "type-punned pointer" "" }
|
||||
tDefEntry** ppT = (tDefEntry**)&list; // { dg-warning "type-punned pointer will" "" }
|
||||
|
||||
struct incomplete *p = (struct incomplete *)&list; // { dg-warning "type-punning to incomplete" "" }
|
||||
|
||||
|
16
gcc/testsuite/gcc.dg/alias-2.c
Normal file
16
gcc/testsuite/gcc.dg/alias-2.c
Normal file
@ -0,0 +1,16 @@
|
||||
// { dg-do compile }
|
||||
// { dg-options "-Wstrict-aliasing=2 -fstrict-aliasing" }
|
||||
|
||||
struct foo {
|
||||
char c;
|
||||
char d;
|
||||
short s;
|
||||
int i;
|
||||
} bar;
|
||||
|
||||
int
|
||||
sub1 (long long int foobar)
|
||||
{
|
||||
struct foo *tmp = (struct foo *) &foobar; // { dg-warning "type-punned pointer might" "" }
|
||||
return tmp->i;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user