From patchwork Wed Dec 11 23:16:55 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: 849308 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp616123wry; Wed, 11 Dec 2024 15:17:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWfQWVGxwpGaPJozZn1Z+BjdzZ2PO/5HwEBQwLKmJmFPFi9L6Vi+156zgjpp7WRD9jPERTR9w==@linaro.org X-Google-Smtp-Source: AGHT+IGqAY+dsyfxrUufbjECQR0X/wRCtdBDkRUOwtGTO/8+tmhAZnrqXNuAjvYmQTXvkuvNoYqe X-Received: by 2002:a05:622a:1884:b0:467:8765:51bb with SMTP id d75a77b69052e-467962347a8mr24303451cf.37.1733959064533; Wed, 11 Dec 2024 15:17:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733959064; cv=none; d=google.com; s=arc-20240605; b=f0hdXzBb/o+tfZbB0omIW/c5trkTTdrr2KXvz8fFHl0J9UsfxjrlKR0SgV5XHV37Qp UwUYxAYdjeal58d9+9nzmM7B1MH7c04SDy3gpumvueCQy7yyDvy7oyZy9ZelWLubxnOa OGR6ZYyrNgjF9MyszsnAz3n1HXmqHqtbyUyqWGfnducAHMmGB32lsD1Wm5nNNP3lGeW2 sjArkws3G+XCaKy6KpXn3gUy7rx665NCHuvesooZbWa6mDhxEhBHJdAJWDf1GtJpnQGT HdVJlt/xmFxY9vXYSpkoKv3gI/orqFQ2BZrdI7mVt/cj5D/pm/sbjUB8ChNbq0wZ5D0x h4Wg== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=gbSGjVPA/lUnmHLhOPQnoo2PcyTUkwD5q//e7yXLaso=; fh=suRWQunXkARhjXNE22rBi+TEhmivCUIXFRkyuBKCh4U=; b=fdMQtlXEzv2XiYPGxQ21Nne5+xTzSBYsEer9Zjnf0Jf4L2uOSG1iTg7iUF2sv/B/zk dXH1Bq/vHgDXJRuO0Co51KWiVlXUvUvtF3x02HoEX3DkoyAKYXcibg5FVPwph+jI9k9M CzVTnXPyv7ZBnBe95ZAisqxBuivtK9AjIOpkJHjaHmegUj+fKnB/WwBBZ+X+mtoDW1+3 mLqDkTPLWR/S/Vowp+p8MpBnxHD9dalWLbOipXysifDdkk7g5roAHgnqYyrJwUCRFLHV syHeFk9K9VgXOtPjcAJL2PtKr2SSvJNUy/zURbjG02anOrRtT6jnD6uydMH5YdLG+jUi uj3g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QAHGtcgx; 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 d75a77b69052e-46753cb6dfcsi113329991cf.697.2024.12.11.15.17.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Dec 2024 15:17:44 -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=QAHGtcgx; 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 1tLVx0-0005xF-Py; Wed, 11 Dec 2024 18:17:02 -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 1tLVwz-0005x0-IG for qemu-devel@nongnu.org; Wed, 11 Dec 2024 18:17:01 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLVwx-0004gt-Ne for qemu-devel@nongnu.org; Wed, 11 Dec 2024 18:17:01 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-385e3621518so4566487f8f.1 for ; Wed, 11 Dec 2024 15:16:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733959017; x=1734563817; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=gbSGjVPA/lUnmHLhOPQnoo2PcyTUkwD5q//e7yXLaso=; b=QAHGtcgx7yfn3mehPzNZGEGf9pw0LAEVTQa3H1/2jZRRYtOPmrEGV1GkRpT6D50ERo R0Z3YyrzoTE0CvZK06f202rpfywWKUCsWm0GL+jC0jNNGGzQjG6NkXa299VqmfKGSH6e 8jB74hwXY/KHt4UuYgys9XByEpKp5QGXEflRR+rXPae5s+PvUdnjmIJNv6nJd3uXzgnl CiJTYg8ymUKncIU4AD8EhKgjGxnk1OxQf4sq8zenSHYPmwCZpiOpx7VLwzJtGpM/TQHN /CyhBnbWZY2/N6SKBYgcKCA9IxMWgXIJR/UEmSlUYJIUm17Vc8626mkMaMzFRnNJFGw4 KWDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733959017; x=1734563817; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gbSGjVPA/lUnmHLhOPQnoo2PcyTUkwD5q//e7yXLaso=; b=CV/mqzEVdaKmD+dEBVDlUFBD10MDRDMZRsCFkuT31JOww5GTt6l41o+pgXfauV5lhX c6SG7zbfeK+10wuiWyd6iqKdKxHhtE09oNkj00b+Xwdqi9591o1rSTxpnuq6Hg+MHvKZ EZGbnu09r2G+6+EKaRu/q9PN+OARsLg799CtznZDIWFfBS8w7lUrSaM/GNZyemioFcCa jr5zQ/T2+oEeYnY40LtH4TTrZ+dqFXD74xt9RLScbOvsTEhcSMMtPDSfvmnjI6K0rtuM Q7OEJQMyKaP8rhMXK05jcXRX1x8ZcDCEaS65f5Ruz63m+m5XjU92Ff4NabedNdl5mOIh fc2A== X-Gm-Message-State: AOJu0YyH5ltgwWB3jv4T6mZYeL/krzPOv2i1ewJZhm/0XuZ8oflW3huh rO5rP5RsKACBfZiENqHh5LMxdI5DcBV9iqO5PU5wFdjUWD5tgWyCYecGhJsnQWM370HILvwQrzC p X-Gm-Gg: ASbGncuiSSektNWKsrwghcX/lVrvZWsH3Am1Tqv0ubAya1ksEyg/oHNmLSvykJJomQF bIlzrVi5Iqg4w6TPI0lB+nk24JndLPYDwLfsIY57q19lu8OqGSgCxuD+IU3Hi240WqxFcAJWLat J0wh/vJOxoGEpAhHmEl0iv3KGIkxawIhgPQi1O64qR0a7Zi765BynJNstbJ06tqLb++Jecgtptl F8Jta5e2+jlvMLZ3laBPw4aEwqBLgCIz4RWLUnAmIxpvAhlCvJOA/CucQ2d/FyWxCRYHg5SNvTq 3gkrikjKyfqbqj75ewhGb4vGSIbTA61zgA== X-Received: by 2002:a5d:6dac:0:b0:386:2ebe:7ae2 with SMTP id ffacd0b85a97d-387876aeddemr1213478f8f.45.1733959017526; Wed, 11 Dec 2024 15:16:57 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3878248f810sm2316596f8f.22.2024.12.11.15.16.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Dec 2024 15:16:57 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [RFC PATCH] meson: Run some compiler checks using -Wno-unused-value Date: Thu, 12 Dec 2024 00:16:55 +0100 Message-ID: <20241211231655.98148-1-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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 running Clang static analyzer on macOS I'm getting: include/qemu/osdep.h:634:8: error: redefinition of 'iovec' 634 | struct iovec { | ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_iovec_t.h:31:8: note: previous definition is here 31 | struct iovec { | ^ 1 error generated. Looking at meson-logs.txt, the analyzer enables -Wunused-value making meson generated code to fail: Code: #include void bar(void) { sizeof(struct iovec); } ----------- stderr: meson-private/tmpe8_1b_00/testfile.c:3:13: error: expression result unused [-Werror,-Wunused-value] 3 | sizeof(struct iovec); | ^~~~~~~~~~~~~~~~~~~~ 1 error generated. ----------- Checking for type "struct iovec" : NO Code: #include void bar(void) { sizeof(struct utmpx); } ----------- stderr: meson-private/tmp3n0u490p/testfile.c:3:13: error: expression result unused [-Werror,-Wunused-value] 3 | sizeof(struct utmpx); | ^~~~~~~~~~~~~~~~~~~~ 1 error generated. ----------- Checking for type "struct utmpx" : NO Code: #include int main(void) { /* If it's not defined as a macro, try to use as a symbol */ #ifndef optreset optreset; #endif return 0; } ----------- stderr: meson-private/tmp1rzob_os/testfile.c:6:17: error: expression result unused [-Werror,-Wunused-value] 6 | optreset; | ^~~~~~~~ 1 error generated. ----------- Header "getopt.h" has symbol "optreset" : NO Code: #include int main(void) { /* If it's not defined as a macro, try to use as a symbol */ #ifndef VMNET_BRIDGED_MODE VMNET_BRIDGED_MODE; #endif return 0; } ----------- stderr: meson-private/tmpl9jgsxpt/testfile.c:6:17: error: expression result unused [-Werror,-Wunused-value] 6 | VMNET_BRIDGED_MODE; | ^~~~~~~~~~~~~~~~~~ 1 error generated. ----------- Header "vmnet/vmnet.h" has symbol "VMNET_BRIDGED_MODE" with dependency appleframeworks: NO ../meson.build:1174: WARNING: vmnet.framework API is outdated, disabling Fix by explicitly disabling -Wunused-value from these meson checks. Signed-off-by: Philippe Mathieu-Daudé --- RFC: Probably meson should do that in has_header_symbol() / has_type()? --- meson.build | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 147097c652e..a431aa982ac 100644 --- a/meson.build +++ b/meson.build @@ -1166,7 +1166,8 @@ cocoa = dependency('appleframeworks', vmnet = dependency('appleframeworks', modules: 'vmnet', required: get_option('vmnet')) if vmnet.found() and not cc.has_header_symbol('vmnet/vmnet.h', 'VMNET_BRIDGED_MODE', - dependencies: vmnet) + dependencies: vmnet, + args: '-Wno-unused-value') vmnet = not_found if get_option('vmnet').enabled() error('vmnet.framework API is outdated') @@ -2690,7 +2691,7 @@ config_host_data.set('CONFIG_RTNETLINK', config_host_data.set('CONFIG_SYSMACROS', cc.has_header_symbol('sys/sysmacros.h', 'makedev')) config_host_data.set('HAVE_OPTRESET', - cc.has_header_symbol('getopt.h', 'optreset')) + cc.has_header_symbol('getopt.h', 'optreset', args: '-Wno-unused-value')) config_host_data.set('HAVE_IPPROTO_MPTCP', cc.has_header_symbol('netinet/in.h', 'IPPROTO_MPTCP')) @@ -2708,10 +2709,12 @@ config_host_data.set('HAVE_BLK_ZONE_REP_CAPACITY', # has_type config_host_data.set('CONFIG_IOVEC', cc.has_type('struct iovec', - prefix: '#include ')) + prefix: '#include ', + args: '-Wno-unused-value')) config_host_data.set('HAVE_UTMPX', cc.has_type('struct utmpx', - prefix: '#include ')) + prefix: '#include ', + args: '-Wno-unused-value')) config_host_data.set('CONFIG_EVENTFD', cc.links(''' #include