blob: 04c064d778f4929beef5eaab52dc8f6ca51ec89c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
/* { dg-options "-Wint-in-bool-context" } */
/* { dg-do compile } */
typedef unsigned u32;
typedef unsigned char u8;
#define KEYLENGTH 8
int foo (u8 plen, u32 key)
{
if ((plen < KEYLENGTH) && (key << plen)) /* { dg-bogus "boolean context" } */
return -1;
if ((plen << KEYLENGTH) && (key < plen)) /* { dg-warning "boolean context" } */
return -2;
return 0;
}
|