From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 7B98E3858404; Fri, 9 Feb 2024 17:30:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7B98E3858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1707499857; bh=3hH/91WEce2Cv9WQXqvj4M1kOMyvvjVWv/jISzfBCUI=; h=From:To:Subject:Date:From; b=Gcy+atQRhSM9zzkNoo9PUG6oiD8jluhWfiAIS0gwQ5+jAL4bDq3Q9/5gZ1jaYoEP8 7MDm5UDElZaX6SULJAufBCTk/9iIXHdtwVgXua/TNvyvX4XzxU8l5u+XyVywbBWpzl Gj89JAjCQ9rI8uXZ7+tx/7sFwyxyCWbyVtTzV2DA= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] timezone: Fix clang operator precedence warning X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: e1b8ef0408e4fef764a11ee27b3e0a75a76fdf1b X-Git-Newrev: 5ff76fae87a9fe10ddaef224c3f19ad9e0dd7de8 Message-Id: <20240209173057.7B98E3858404@sourceware.org> Date: Fri, 9 Feb 2024 17:30:57 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5ff76fae87a9fe10ddaef224c3f19ad9e0dd7de8 commit 5ff76fae87a9fe10ddaef224c3f19ad9e0dd7de8 Author: Adhemerval Zanella Date: Thu Mar 10 16:44:45 2022 -0300 timezone: Fix clang operator precedence warning clang issues: zdump.c:669:7: error: operator '?:' has lower precedence than '&'; '&' will be evaluated first [-Werror,-Wbitwise-conditional-parentheses] ? (delta(&tm, &lotm) == t - lot which is exactly what the code intendes. Instead of adding a warning suppress, place parentheses around the '&' expression. Diff: --- timezone/zdump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timezone/zdump.c b/timezone/zdump.c index b532fe3eae..bfc01faffa 100644 --- a/timezone/zdump.c +++ b/timezone/zdump.c @@ -665,7 +665,7 @@ hunt(timezone_t tz, char *name, time_t lot, time_t hit) else if (t >= hit) --t; tm_ok = my_localtime_rz(tz, &t, &tm) != NULL; - if (lotm_ok & tm_ok + if ((lotm_ok & tm_ok) ? (delta(&tm, &lotm) == t - lot && tm.tm_isdst == lotm.tm_isdst && strcmp(abbr(&tm), ab) == 0)