* gcc.dg/alias-1.c: Add "will" to string passed to dg-warning.
* gcc.dg/alias-2.c: New testcase.
From-SVN: r79223
+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.
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" "" }
--- /dev/null
+// { 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;
+}