Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / Wenum-int-mismatch-3.c
blob4ddbeb152d8a957c8fe3eeeaf6bccd064fd9a917
1 /* PR c/105131 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wc++-compat -fno-short-enums" } */
5 enum E { E1 = -1, E2 = 0, E3 = 1 };
7 int foo(void); /* { dg-message "previous declaration" } */
8 enum E foo(void) { return E2; } /* { dg-warning "conflicting types" } */
10 void bar(int); /* { dg-message "previous declaration" } */
11 void bar(enum E); /* { dg-warning "conflicting types" } */
13 extern int arr[10]; /* { dg-message "previous declaration" } */
14 extern enum E arr[10]; /* { dg-warning "conflicting types" } */
16 extern int i; /* { dg-message "previous declaration" } */
17 extern enum E i; /* { dg-warning "conflicting types" } */
19 extern int *p; /* { dg-message "previous declaration" } */
20 extern enum E *p; /* { dg-warning "conflicting types" } */
22 enum E foo2(void) { return E2; } /* { dg-message "previous definition" } */
23 int foo2(void); /* { dg-warning "conflicting types" } */
25 void bar2(enum E); /* { dg-message "previous declaration" } */
26 void bar2(int); /* { dg-warning "conflicting types" } */
28 extern enum E arr2[10]; /* { dg-message "previous declaration" } */
29 extern int arr2[10]; /* { dg-warning "conflicting types" } */
31 extern enum E i2; /* { dg-message "previous declaration" } */
32 extern int i2; /* { dg-warning "conflicting types" } */
34 extern enum E *p2; /* { dg-message "previous declaration" } */
35 extern int *p2; /* { dg-warning "conflicting types" } */
37 enum F { F1 = -1, F2, F3 } __attribute__ ((__packed__));
39 enum F fn1(void); /* { dg-message "previous declaration" } */
40 signed char fn1(void); /* { dg-warning "conflicting types" } */
42 signed char fn2(void); /* { dg-message "previous declaration" } */
43 enum F fn2(void); /* { dg-warning "conflicting types" } */