From patchwork Thu Sep 12 06:52:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 827788 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp1128039wrc; Wed, 11 Sep 2024 23:54:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXzztgJSF6IcnKEr3kRau+P2c67Vv59MAj3CFgjLQd6gg440pF6ISr8ua14ahApgkAt2FRi7g==@linaro.org X-Google-Smtp-Source: AGHT+IFk5aFt1w14VCH6+TEwh2BxkOayl6AWnFtVJYOhAT7/3Llb97nuZOWMx7bLPh54AK6mzYtA X-Received: by 2002:a05:6214:3a02:b0:6c3:68d0:350d with SMTP id 6a1803df08f44-6c573510bcfmr32521316d6.14.1726124098075; Wed, 11 Sep 2024 23:54:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726124098; cv=none; d=google.com; s=arc-20240605; b=KTHxHiq6ekLXO4JW21z2+4MIFQ9zUibCZGp6Tizugla3BRNYGyk52On3Icdg3A9H2R G+yuwDKuPjbnN3CZWEVbHKRk+jxSNaaaJjChkOezsfdjnTjTpz771Ag2kJxdde3mDn69 ydIBPVf6VB7CtkKXnRgVxD2bFx1rvlqhSjDsH4Fi2SHp5i+6eWck448CsFlxBMx0hqu3 KrLvqektwkbCBpQizerCWO10RSGXx5hyoQYyl3ntiIrqyeEamsopHQI4OKYpjijdKRlA 0pvlhgIFQYjszcRAx2XcdVFBL4d/ICqkuWFMI7ZOGBSgRUTMkqkDx/Ulete7nBVJmqL9 d8Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:to:from :dkim-signature; bh=jtNJDIJpUDW0bpRhizb3Cf8FodNOF9sdbTjBD++YWOI=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=RPxyXxSy/nAFgFI5Tv1ZGeNj2NV5jUVNxpsqhrVyRuatDmSuw0CgA8phhpyVUu8/gU c7+y6wLHtgk4yxwb9qoH4oX9ZZgsfPU8pKdrC/cAk0WhHgCxaXGXegvo7vWhWjEnKXKn aztcpoocsALQqxI4wqCIhi9rbY8mi/VJXe0TPFk9gW2mcdfXj8RK+qx43Hum/qLOKtQb qhzlJjrDyRL1iHCJIPuI0beIXuPTIw+5aEddDMbe5Uy0uh09Vg4m3tW4Y3JI5APwUrTq W50+M0ahd7JgcbxJdcHOYj8CsteSoFNAxtt7BYdNvK5xWk/FPi/GaNM2X0U52n8K+gxt jlRg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OOBjTxjR; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6c53478299fsi119361436d6.355.2024.09.11.23.54.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2024 23:54:58 -0700 (PDT) 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=OOBjTxjR; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sodiC-000197-V9; Thu, 12 Sep 2024 02:53:54 -0400 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 1sodi1-0000lF-2t for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:41 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sodhz-0003Vl-7p for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:40 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-374c7e64b60so404020f8f.2 for ; Wed, 11 Sep 2024 23:53:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726124017; x=1726728817; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=jtNJDIJpUDW0bpRhizb3Cf8FodNOF9sdbTjBD++YWOI=; b=OOBjTxjRedfsg000zdCcywmC7wd+EohaoAPOteRVous/V4/87O7p9R9Y1rOP+iEF7/ c+UrWcLX6evU6ft4k5xwe9suskHomuyhqlGsDv85tBueVXSC+yN145a/D0Bqx4nmJReT Jv1HTkw5Tj+qGskA+sK4SbiPCgdif3ljEDwb7QjnQRAzLbKie2rumMALzuV7R/ruV9HZ nQbQ7hofEpnY5tzRou5alk8GJCuPHKkq0g9Nxh1FJ82vZfvFAvSZOeB7Eq7oUJumBA5v B6lwER1gHRc4PHoSWfcr+eCXrH8KA6U3+CImgVLAl623nis6/P/QYIvP+Q3jPX/tul5D pMJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726124017; x=1726728817; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jtNJDIJpUDW0bpRhizb3Cf8FodNOF9sdbTjBD++YWOI=; b=s5QfuWYy2m9Sa3YKW5OX3+4Yik0i1tAqPtzDQdYuUMBAaenb70AruHhuiiQ3DiU6GS mh3v1NcLIWIMy9p1V0CJyjIxhSAcI27+vfllBXpIlo41HTnyw8TbnacJzpu8hGXJYaFs 68VpxxPV1XYsXhnmx0v0SX17o8cy5QYhnGo/d6qwAl06VksrWtUEd++USQ9DgJpBW+Li aBZIAm2iJM5VVRshn0JPXFZqVEnWiyl0Kh2yJbncrPXShqE9RUNXVU4EUBvhbj0MIZup 9KuX7ZnC0fFS4v2DpLOspW7PPrnPnMcWN764K1QUYWNCdKA/nIdZ35lbfsUgyMgLe0NJ tUjg== X-Gm-Message-State: AOJu0YwG8n+ZtrfugcQQKEWgvM0S2MFrmlyfWK4XMAGuIHbgfg0KH2Y3 EErRhkOoi5jVgWqWONHJ9gnwqv09OZ9tZ5xwbeKEliN0bONBk5TGVnCWvIoE9kj3tcmAvKxvsid z X-Received: by 2002:a05:6000:ac4:b0:366:ee9b:847 with SMTP id ffacd0b85a97d-378c2d05d7emr900018f8f.14.1726124017186; Wed, 11 Sep 2024 23:53:37 -0700 (PDT) Received: from m1x-phil.lan (mic92-h03-176-184-33-210.dsl.sta.abo.bbox.fr. [176.184.33.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378956653f9sm13440159f8f.31.2024.09.11.23.53.36 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Sep 2024 23:53:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL v2 57/61] system: replace assert(0) with g_assert_not_reached() Date: Thu, 12 Sep 2024 08:52:26 +0200 Message-ID: <20240912065227.67848-13-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240912065227.67848-1-philmd@linaro.org> References: <20240912065227.67848-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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 From: Pierrick Bouvier Use of assert(false) can trip spurious control flow warnings from some versions of GCC (i.e. using -fsanitize=thread with gcc-12): error: control reaches end of non-void function [-Werror=return-type] default: assert(0); | } | ^ Solve that by unifying the code base on g_assert_not_reached() instead. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240910221606.1817478-11-pierrick.bouvier@linaro.org> [PMD: Add description suggested by Eric Blake] Signed-off-by: Philippe Mathieu-Daudé --- system/rtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/rtc.c b/system/rtc.c index dc44576686..216d2aee3a 100644 --- a/system/rtc.c +++ b/system/rtc.c @@ -62,7 +62,7 @@ static time_t qemu_ref_timedate(QEMUClockType clock) } break; default: - assert(0); + g_assert_not_reached(); } return value; }