Message-ID: Date: Tue, 4 Oct 2022 17:01:41 +0200 MIME-Version: 1.0 Content-Language: en-US References: <20221004145142.19091-1-gert@...1296...> From: Antonio Quartulli In-Reply-To: <20221004145142.19091-1-gert@...1296...> Subject: Re: [Openvpn-devel] [PATCH] use boolean '||' to join two bools, not bitwise '|' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit To: Gert Doering , openvpn-devel@lists.sourceforge.net Hi, On 04/10/2022 16:51, Gert Doering wrote: > FreeBSD 14 clang complains about this: and it is right. > > init.c:3530:13: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical] > platform_group_get(c->options.groupname, &c0->platform_state_group) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > init.c:3530:13: note: cast one or both operands to int to silence this warning > 1 warning generated. > > .. so do what it wants us to do. > > Signed-off-by: Gert Doering Acked-by: Antonio Quartulli > --- > src/openvpn/init.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/openvpn/init.c b/src/openvpn/init.c > index 03416844..c88c0915 100644 > --- a/src/openvpn/init.c > +++ b/src/openvpn/init.c > @@ -3528,7 +3528,7 @@ do_init_first_time(struct context *c) > /* get user and/or group that we want to setuid/setgid to */ > c0->uid_gid_specified = > platform_group_get(c->options.groupname, &c0->platform_state_group) > - |platform_user_get(c->options.username, &c0->platform_state_user); > + || platform_user_get(c->options.username, &c0->platform_state_user); > > /* perform postponed chdir if --daemon */ > if (c->did_we_daemonize && c->options.cd_dir == NULL) -- Antonio Quartulli