From patchwork Thu Sep 12 06:52:22 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: 827781 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp1127722wrc; Wed, 11 Sep 2024 23:53:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWx+GYA8uNU0bb1/A8dLSAVhxuuGBCVTnzW8Duh2q8vch1WrZwCbFTrmAF3MSmSRWMu9zCm3A==@linaro.org X-Google-Smtp-Source: AGHT+IFr1cFNEqq8ZFqIeqCG0NY4WsfOTHEVQ+CpZFuU58OCWlMaMXJZIsJ1I+mqwOEvgLLmTO9T X-Received: by 2002:a05:620a:4693:b0:7a9:bae1:a1fd with SMTP id af79cd13be357-7a9e5f78e41mr277222085a.50.1726124010031; Wed, 11 Sep 2024 23:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726124010; cv=none; d=google.com; s=arc-20240605; b=JqpWU9xefcHSa9XKt2a2NYSUB5odXWGxK+ApEdlf8dIAaulEBxShPYq/tntyzkjWmy O/M/QACYHHdhznlBV2F1hXYPxX7/CfUzTagY1YDfGFx+7wmEcaRMYd65gtVEGe9O5hqj lpWcRSBi979ZC0MoRGANnQZsNHbxRCK4OmvQsCqFeJpXAP7GVorp8WAejx9yo9BnwnCZ 6xQqLnCPFeK21ixCRTMIDuYtlYfjZzNfdyberQ0SuOwm1xnjChAMpDrm2uWCacPn4RT8 jqidvpL8njYKEUyTzWNLcsThkTep3MMDnEO4RbT3u6MnF1pB9KJSXImZVXU9M56TbjzI Htew== 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=CgFUNHEs52jLsHHSU5YLFjyTmIMNSfp3u0OOxY3dyBs=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=iHbLmgFFObzEGgmC437kfP4V7moM9y5Tkt/05st9PhPRxtYENVNsOxduLZ6gaoCFJO g3T2ZENjAmgE2a0s5XeQFwPhGtrUAg99mN4YPPKJKtPuvetqDmnz9JSYD4i4zoRG1/bJ 0ZtK+/3vfl4NDnLPNWrZ4CzRsacDSF4MFOH1/gaHmBPi3oo+sXcqp96zlgm2gl8n/Zl/ 1TpUU4dMYBjdYhE1iuIzvb8M29RTU7/Iro/A5aKza5ioOr2TdE5UmQ04E1wHW4JD4gpx cODBcuezMK0hLguiXAvShJADHd5iQeqJ6cO/0vnO2GPDu6fwy1mEWWr6TANJF70FSzxQ cl0A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iFHcYUeF; 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 af79cd13be357-7a9a7a55ab7si1242145585a.544.2024.09.11.23.53.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2024 23:53:30 -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=iFHcYUeF; 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 1sodhk-0007X2-Qg; Thu, 12 Sep 2024 02:53:25 -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 1sodhe-00078h-Ot for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:19 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sodhd-0003Tl-51 for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:18 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-42cde6b5094so3337575e9.3 for ; Wed, 11 Sep 2024 23:53:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726123995; x=1726728795; 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=CgFUNHEs52jLsHHSU5YLFjyTmIMNSfp3u0OOxY3dyBs=; b=iFHcYUeFWMfxm8Lrvr83A9DQOl4TIW1jzGERRCNxE3or2PV7L675SYnnrWN+lpM5oy ZvcvugUSEJgFzBmRofubOQZ+NxaR34PtGAQnrgEb7tfAGQu+ohME34PJ3ojuNhVMGp3o HSOzVInmMW3zPkfKrl8jQgicpuDVJiC58Fkgp5FIz7j7UAJUpQgHHPmUKpW7bEJyTlrP Lymf3qpAqCMlX4noJIi/ClAHF//RxWSxL2ftdcTPgy4SdLEN82+9jxgEpKEzPXDBZUXH NIFpqH0qYe+S9c3ieRMNz1ZulxZIF+QixlUs2oMcY1ygrDE2rw0051VPAS4zmkugTfO8 sq3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726123995; x=1726728795; 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=CgFUNHEs52jLsHHSU5YLFjyTmIMNSfp3u0OOxY3dyBs=; b=LdpceVzOyNt9FaSXgLYIsOkGe1ksQBVSvS4jg5EQJmUYtEk0YoYQeSIzus4NssAqSS oQjUiLJ2gdbWrLER8NVSmxg+mtc9icYTl+S1E+zOakl0G7g9a4eerIutH9vaNt7hyQTo 4SeYdHudG9RIcckMa53tNaaXiQ21N/PocynmnF3aYkWVxc8BefdDdgyTo3wRQFQ8M8Ll 59M89tjy0jAi6ACTJlHLQ3bHRbKZqbDKS1DnElJ9XN8TcQk9vxSxVIV4L0hv8Z3bK4J/ lpVMFHRD6nBGxytEBQP2kmf6Wl9SVZbZWKl0w4kNsoa+ALRTKsn8UEa3PhZBQQWYBENC UH+A== X-Gm-Message-State: AOJu0YxLdm5yzveRSh7SEWTTaZ3mwQXaF46uJnfmA1LgcdqwT/lEti52 0nmXabjr+TrlIoHwK0UgH7pACZsU56M0ab/XhhcuKXxHmWMtzcRCDzB9AQoUNX04VEchSQnCr1k i X-Received: by 2002:a05:600c:45cf:b0:42c:bdb0:c61e with SMTP id 5b1f17b1804b1-42cdb547f05mr13201675e9.13.1726123995352; Wed, 11 Sep 2024 23:53:15 -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 5b1f17b1804b1-42caeb21cdfsm161707405e9.10.2024.09.11.23.53.14 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Sep 2024 23:53:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL v2 53/61] hw/watchdog: replace assert(0) with g_assert_not_reached() Date: Thu, 12 Sep 2024 08:52:22 +0200 Message-ID: <20240912065227.67848-9-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::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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é Reviewed-by: Richard W.M. Jones Message-ID: <20240910221606.1817478-8-pierrick.bouvier@linaro.org> [PMD: Add description suggested by Eric Blake] Signed-off-by: Philippe Mathieu-Daudé --- hw/watchdog/watchdog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c index 955046161b..d0ce3c4ac5 100644 --- a/hw/watchdog/watchdog.c +++ b/hw/watchdog/watchdog.c @@ -85,7 +85,7 @@ void watchdog_perform_action(void) break; default: - assert(0); + g_assert_not_reached(); } }