PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / c-c++-common / Wsign-compare-1.c
blobb9b17a99280d943086db1c81bc358ef341f38b9e
1 /* PR c/81417 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wsign-compare" } */
5 int
6 fn1 (signed int a, unsigned int b)
8 return a < b; /* { dg-warning "comparison of integer expressions of different signedness: 'int' and 'unsigned int'" } */
11 int
12 fn2 (signed int a, unsigned int b)
14 return b < a; /* { dg-warning "comparison of integer expressions of different signedness: 'unsigned int' and 'int'" } */
17 int
18 fn3 (signed long int a, unsigned long int b)
20 return b < a; /* { dg-warning "comparison of integer expressions of different signedness: 'long unsigned int' and 'long int'" } */
23 int
24 fn4 (signed short int a, unsigned int b)
26 return b < a; /* { dg-warning "comparison of integer expressions of different signedness: 'unsigned int' and 'short int'" } */
29 int
30 fn5 (unsigned int a, signed int b)
32 return a < b; /* { dg-warning "comparison of integer expressions of different signedness: 'unsigned int' and 'int'" } */