From patchwork Tue Feb 21 15:30:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 655376 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp156186wrb; Tue, 21 Feb 2023 07:31:02 -0800 (PST) X-Google-Smtp-Source: AK7set9RBrwDdZavoFFFy1HJl+0NkGRbZ/DN3zqx6+Z9U/jorKdZ2+wFu/eOwnA3U159L/sb2LzM X-Received: by 2002:ac8:7d89:0:b0:3b2:365c:9a9e with SMTP id c9-20020ac87d89000000b003b2365c9a9emr8278929qtd.61.1676993462559; Tue, 21 Feb 2023 07:31:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676993462; cv=none; d=google.com; s=arc-20160816; b=0r9Mz/lKIUeMHGJ0yqUJ79pFJz5pOKxcvwrQLK53wkBzfM9U5poAK3ws0RxjMsLsqz mbjRB13M9qAbz0cyS6cLd9NFrpBjHhwmIbQjc7lKo1xr7H5g5kKYWN31sCZnIbxtrKje tuzUZQ41c/Z5/assQ8Ls1a/GB6V+7SmNw7/9zqWB9o8xVPOnLWabOlelIrUGYJIGlQKe wTgcoxiLTby4GNV+rLYYZbkk+w00qpaSxlIN96gZ7ws5mvx4DAFy89/nGtn8DrLhYJBX PjM+qHg/9fg91Qkq39EX4RkivY9xMFy5/X+2pIwdFSQUKiRaITGhy5d01AZepFep4MGx MtJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6qn/yx6q7lkoNAawrOJ+PdaXBlkustX5jFFPd6NUzvQ=; b=FXByuK9+iqAjqkqtPWY3gXmkItPaLnb5oK/VZlOZEWOSudkjJo5c6hACOK+YpumIBo 6fzg10BnKOYKGXSoSGwZzitZNyql1JLwQbfVNFsa+LqMOarcCBGXIJ6epEeZwIsn+Pgu 3To3aaKhh79nz5GDhN4NzDhdBPhe68oNcSYvHxGcSikt53eqz4t6CIftCXKNHDVyT763 kjPoxnT86T+nzpXKwBRQU93C/uzqhcex0LOXWgWUtwZ3xk+v+8jOevA+HvsFJxHvaFLr dnb8SAyq20bu0cIF7/XaQCfTYZEQVHFhTYxfEkweMjQ6muk77Zo2vc0S1YxQUDSdOUcz r6Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ml40aHav; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x20-20020a05622a001400b003bb7aacfce4si23146qtw.444.2023.02.21.07.31.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Feb 2023 07:31:02 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ml40aHav; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUUbR-0002en-CI; Tue, 21 Feb 2023 10:30:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUUb7-0002Kk-JY for qemu-devel@nongnu.org; Tue, 21 Feb 2023 10:30:37 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUUb5-0000W1-O2 for qemu-devel@nongnu.org; Tue, 21 Feb 2023 10:30:29 -0500 Received: by mail-wr1-x435.google.com with SMTP id j2so4689123wrh.9 for ; Tue, 21 Feb 2023 07:30:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6qn/yx6q7lkoNAawrOJ+PdaXBlkustX5jFFPd6NUzvQ=; b=ml40aHavkBRi/dbzj4cK6sMbIjJ7JFkzV7+TNrTJgbkpCdNYnLWnhPMNYwKz+MYnjN z7BXniOl2kWi58pbWWFOH5yfgLNP378Fl/KazgRzJG/C6al8wrmy7Jlsbcv9tSgHZZw2 oe2dwj9Wm9EbQH+pnxJJTz5qMQQ4BOoumK6tDEXd3N164bkNDJ9CDl4epqLYcRkVZVdW fwfz1k9/lx4KuuGhNkGGR9gj1lFC0x8bEeHWs0NaZNSY3u4jQ1n9ERFhmgMD7McLAjV1 K9FKF7DRZBpItrScj24f5yOavNsMJbFruGw1X/KQ4bgyBDty1XWR4A8O1hpLW7h3nj+0 hZiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6qn/yx6q7lkoNAawrOJ+PdaXBlkustX5jFFPd6NUzvQ=; b=29Ajy9NSQk8PZ6gnf4Qu4gP7zqCs+802ji3o7YeUhAC7OH/1K/LcCfD5MVLq0WDodU CRDsyV8q77irMw103XjiwU/nZaMCXh3WazA/lLNP1TVDb5sYJdr8CVK7UpVwNkWpvYRx i2ArvniQDarAhcZKgrJuCGPsGLCQYYPcF5EFpPpOmd3YBXq+SCDSUO/5R9FQLxcfzjdw 7AGSOU6NwUsn1DFp/d36DIOxHMgqshd8hk/8XaMDLMRiWtjKe+a4nW/6rpDCNC+Dld3b bTplyHIauwu3sCH51U18EEUHoJQPMZAM4lrWOXH8waryAgldY13lAZxUbn7CH1UdKKhs H7ww== X-Gm-Message-State: AO0yUKUMOC68LGdObG5TQ7JZQDh9alpreI3RrA+0OMyR83b9qSZDK2GT Bb5chnzxJElqOtjv0RoTy/wnyK1xKsmHDuBEkpQ= X-Received: by 2002:adf:f748:0:b0:2c5:534d:eebb with SMTP id z8-20020adff748000000b002c5534deebbmr3036071wrp.13.1676993425859; Tue, 21 Feb 2023 07:30:25 -0800 (PST) Received: from volterra.localdomain ([2a01:e0a:5cc:caa0:c49d:d14a:e6ed:555a]) by smtp.gmail.com with ESMTPSA id r1-20020adfdc81000000b002c5503a8d21sm2803417wrj.70.2023.02.21.07.30.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 07:30:25 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: sw@weilnetz.de, kkostiuk@redhat.com, clg@kaod.org, richard.henderson@linaro.org, alex.bennee@linaro.org, peter.maydell@linaro.org, philmd@linaro.org, Pierrick Bouvier Subject: [PATCH v4 4/4] target/ppc: fix warning with clang-15 Date: Tue, 21 Feb 2023 16:30:06 +0100 Message-Id: <20230221153006.20300-5-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230221153006.20300-1-pierrick.bouvier@linaro.org> References: <20230221153006.20300-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org When compiling for windows-arm64 using clang-15, it reports a sometimes uninitialized variable. This seems to be a false positive, as a default case guards switch expressions, preventing to return an uninitialized value, but clang seems unhappy with assert(0) definition. Change code to g_assert_not_reached() fix the warning. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/ppc/dfp_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/dfp_helper.c b/target/ppc/dfp_helper.c index cc024316d5..5967ea07a9 100644 --- a/target/ppc/dfp_helper.c +++ b/target/ppc/dfp_helper.c @@ -121,7 +121,7 @@ static void dfp_set_round_mode_from_immediate(uint8_t r, uint8_t rmc, case 3: /* use FPSCR rounding mode */ return; default: - assert(0); /* cannot get here */ + g_assert_not_reached(); } } else { /* r == 1 */ switch (rmc & 3) { @@ -138,7 +138,7 @@ static void dfp_set_round_mode_from_immediate(uint8_t r, uint8_t rmc, rnd = DEC_ROUND_HALF_DOWN; break; default: - assert(0); /* cannot get here */ + g_assert_not_reached(); } } decContextSetRounding(&dfp->context, rnd);