summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wtraditional-conversion.c
blob: a3f04acb5f824533d821b7ec5d7a15ebe784309a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Source: PR 137.

   We would not warn about passing an enum, but would warn about
   passing a enum that was part of an array.  TYPE_MAIN_VARIANT was
   not used in the appropriate place in the warning code.  */

/* { dg-do compile } */
/* { dg-options -Wtraditional-conversion } */

typedef enum { a } __attribute__((packed)) t;
void f(t x) {}

int main(void)
{
  t x[2], y;
  f(x[0]);			/* { dg-bogus "different width" } */
  f(y);				/* { dg-bogus "different width" } */
  return 0;
}