PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / c-c++-common / Wint-in-bool-context-2.c
blob04c064d778f4929beef5eaab52dc8f6ca51ec89c
1 /* { dg-options "-Wint-in-bool-context" } */
2 /* { dg-do compile } */
4 typedef unsigned u32;
5 typedef unsigned char u8;
6 #define KEYLENGTH 8
8 int foo (u8 plen, u32 key)
10 if ((plen < KEYLENGTH) && (key << plen)) /* { dg-bogus "boolean context" } */
11 return -1;
13 if ((plen << KEYLENGTH) && (key < plen)) /* { dg-warning "boolean context" } */
14 return -2;
16 return 0;