annotate gcc/testsuite/gcc.dg/Wtraditional-conversion.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Source: PR 137.
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 We would not warn about passing an enum, but would warn about
kono
parents:
diff changeset
4 passing a enum that was part of an array. TYPE_MAIN_VARIANT was
kono
parents:
diff changeset
5 not used in the appropriate place in the warning code. */
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 /* { dg-do compile } */
kono
parents:
diff changeset
8 /* { dg-options -Wtraditional-conversion } */
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 typedef enum { a } __attribute__((packed)) t;
kono
parents:
diff changeset
11 void f(t x) {}
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 int main(void)
kono
parents:
diff changeset
14 {
kono
parents:
diff changeset
15 t x[2], y;
kono
parents:
diff changeset
16 f(x[0]); /* { dg-bogus "different width" } */
kono
parents:
diff changeset
17 f(y); /* { dg-bogus "different width" } */
kono
parents:
diff changeset
18 return 0;
kono
parents:
diff changeset
19 }
kono
parents:
diff changeset
20