commit 4521cc8f0aade2082ec19d310fbc4facc1158f32
parent b953ac1cdd26aad71a91905475ce2ff1a0a9cbc8
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Tue, 14 Jun 2022 20:13:16 +0200
cc1: Fix expression evaluation order
The operator & has higher precedence than the operator && so
it is very unlikely that you want to do a bitweise and with the
result of a shortcut and.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cmd/cc/cc1/decl.c b/src/cmd/cc/cc1/decl.c
@@ -48,7 +48,7 @@ struct decl {
static void
endfundcl(Type *tp, Symbol **pars)
{
- if (tp->prop&TK_R && *pars)
+ if ((tp->prop&TK_R) != 0 && *pars)
warn("parameter names (without types) in function declaration");
/*
* avoid non used warnings in prototypes