(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
Wenum-int-mismatch-2.c
       1  /* PR c/105131 */
       2  /* { dg-do compile } */
       3  /* { dg-options "-Wall -fno-short-enums" } */
       4  
       5  enum E { E1 = 0, E2, E3 };
       6  
       7  unsigned int foo(void); /* { dg-message "previous declaration" } */
       8  enum E foo(void) { return E2; } /* { dg-warning "conflicting types" } */
       9  
      10  void bar(unsigned int); /* { dg-message "previous declaration" } */
      11  void bar(enum E); /* { dg-warning "conflicting types" } */
      12  
      13  extern enum E arr[10]; /* { dg-message "previous declaration" } */
      14  extern unsigned int arr[10]; /* { dg-warning "conflicting types" } */
      15  
      16  extern unsigned int i; /* { dg-message "previous declaration" } */
      17  extern enum E i; /* { dg-warning "conflicting types" } */
      18  
      19  extern unsigned int *p; /* { dg-message "previous declaration" } */
      20  extern enum E *p; /* { dg-warning "conflicting types" } */
      21  
      22  enum E foo2(void) { return E2; } /* { dg-message "previous definition" } */
      23  unsigned int foo2(void); /* { dg-warning "conflicting types" } */
      24  
      25  void bar2(enum E); /* { dg-message "previous declaration" } */
      26  void bar2(unsigned int); /* { dg-warning "conflicting types" } */
      27  
      28  extern unsigned int arr2[10]; /* { dg-message "previous declaration" } */
      29  extern enum E arr2[10]; /* { dg-warning "conflicting types" } */
      30  
      31  extern enum E i2; /* { dg-message "previous declaration" } */
      32  extern unsigned int i2; /* { dg-warning "conflicting types" } */
      33  
      34  extern enum E *p2; /* { dg-message "previous declaration" } */
      35  extern unsigned int *p2; /* { dg-warning "conflicting types" } */
      36  
      37  enum F { F1 = 1u, F2, F3 } __attribute__ ((__packed__));
      38  
      39  enum F fn1(void); /* { dg-message "previous declaration" } */
      40  unsigned char fn1(void); /* { dg-warning "conflicting types" } */
      41  
      42  unsigned char fn2(void); /* { dg-message "previous declaration" } */
      43  enum F fn2(void); /* { dg-warning "conflicting types" } */