Commit 8a308d45 by James E Wilson Committed by Jim Wilson

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
parent 5399d643
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" "" }
......
// { 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment