2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / Wconversion.c
blob7cbcb6a4461b06d6b63c08a3db14305a84e0bf96
1 /* Source: PR 137.
3 We would not warn about passing an enum, but would warn about
4 passing a enum that was part of an array. TYPE_MAIN_VARIANT was
5 not used in the appropriate place in the warning code. */
7 /* { dg-do compile } */
8 /* { dg-options -Wconversion } */
10 typedef enum { a } __attribute__((packed)) t;
11 void f(t x) {}
13 int main(void)
15 t x[2], y;
16 f(x[0]); /* { dg-bogus "different width" } */
17 f(y); /* { dg-bogus "different width" } */
18 return 0;