From patchwork Wed Dec 18 18:21:00 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: 851751 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1078051wrq; Wed, 18 Dec 2024 10:22:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWNk1WGVHo18O0Qj8aAzKtuBiAjXKB4HMR+AjR7bAh+sLcA9DTNAcZOymMqYXn4UOijxESG/g==@linaro.org X-Google-Smtp-Source: AGHT+IEnl4wuYObokm4/nW4X/ikXqeaVvjQ97XDGVyFQhjZETA/A01XHzabcj5b/h9MEb6JINYL3 X-Received: by 2002:a05:6102:a48:b0:4b1:1565:f4f1 with SMTP id ada2fe7eead31-4b2ae7010f1mr3619383137.3.1734546150208; Wed, 18 Dec 2024 10:22:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734546150; cv=none; d=google.com; s=arc-20240605; b=Etn7zhcn4uJatzlo4NSOZntF+rqNA6YIdsQMgsNP0DrB9FouhdBBCH7+Q5FDtWdBbZ 5tNK5RXQnCLUltIkolF2ecU5HCPrjJd3zAnay8KXS2gTO/m1R5a6vv7Wp+2GoDnTbk5l B1MvXnkSBjlqW/ggZBjwCw29zJcRvD5KRODe9QEStyYjmulGWZMroPUbK7hdtYx0DEt9 1ZdbIQO8dG5yjOZhHm6R3wJW4GH6ZdbUTdHLY6AO4Y4pJ+nkIp+v/lOIz2RsNjbODdyY vfwfplz9RMKr/3nUeWKhaM+SlisjWx8V0/x6K+uvDpqOfvrkS2xubFZk4jBn2fbANIVu iruQ== 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:cc:to :from:dkim-signature; bh=exZ5QnwADXlGe9wvGwI3Js3yOyhSQnQyZpyAMP6GlqA=; fh=aDK3AYW/tYhipRsN4fimbcHK1l9GCjVTlWyiAdYPq8A=; b=hijS11JsiL/EMYS03vulmjpI5NgbRfUR8kYcvvkl4QqXCaF8n+pTe1NX6VFfhKVhRv 7VwZy0OrMdmxouBwec0U5Tc5NIM4f+AoWyo0CihFOOyQTQlZuXWOpztELql5btGi4KMP lMi5keZTVH/qqx6Tuu/zAuCuPSITAlqg8vGZzSUxTvc9EWnWYoI2x7U4pvNGatBGOLGh HEs/XURwg4mrrTzlyYd6IBBCP8waYfe98jLBKMU/qSRtO7/lMh1CkTz7zeGoQkaBqhfQ fKDgutbJ7WUMcT/1i/6xxWxYZk/2Di+Qg99OIoTvnOW0ESqZgyXjHvZATBR3ZaWJVsiM IeQg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=od5Fl3mW; 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 ada2fe7eead31-4b2702048ccsi3856778137.33.2024.12.18.10.22.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Dec 2024 10:22:30 -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=od5Fl3mW; 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 1tNyfe-00009f-PY; Wed, 18 Dec 2024 13:21:18 -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 1tNyfd-00008Z-I1 for qemu-devel@nongnu.org; Wed, 18 Dec 2024 13:21:17 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNyfb-0001kz-Ua for qemu-devel@nongnu.org; Wed, 18 Dec 2024 13:21:17 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3863703258fso719349f8f.1 for ; Wed, 18 Dec 2024 10:21:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734546074; x=1735150874; darn=nongnu.org; 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=exZ5QnwADXlGe9wvGwI3Js3yOyhSQnQyZpyAMP6GlqA=; b=od5Fl3mWnYbf/F/CfuE7Lg9LGoJq3yZQk2kQKLI2UTWJg/MoP7a6vqo/DKYwBPummN AExXNP02oci6M1KAgnOr5SLEkbiaCppiuSOd+lQNb9O3xxYcdARTVdnQrEUlGwWQQdCz wdRmkFVC3FmoHo+i+JqqU/PnHhMbyK9RvMXfFhfxEW1irELikxmnKAwi6vxnAi+Uuq80 YOuzWSDkMAmoMCV9DbRLvrSAKh+whux0EQobbntNmk0UTYvEBVro/Rpnx7EeChZRqh01 2W7Y5mSLlk46XpPQgjLkHtnaiZhp4gXazYyEXl8q+TQiwGO0GHFv0uWjg9IWOPTJAqJ1 9nOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734546074; x=1735150874; 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=exZ5QnwADXlGe9wvGwI3Js3yOyhSQnQyZpyAMP6GlqA=; b=jxCRCosTT05r7hMR7AAxuAKMNKectXWUy56bpxpy6PBB1ESRwshqHWfeYfS1DDxkmB 9PQ80tmIxFyzCEu3CnQEOZrlp+5puk0SlNkz+sUk47Wa1q1JSWs18fOhn5UCIlbXcHrg M9kxZCo2E5U4zfbiEeQSlSnCfeKggalXUjh0JEQaUelDbzCmRtMZEuMjMNjg66/fNTZM 724Ythweu7kZNIDGNtQ0QF5JjyMjlWgrVo4xctg0U7TvNkzaEMEBq6l2jMgwc/bNCtCh kox7uQv/Ce5xUJFVaZZBlg6v50ebUkObRn4r5vjoVNQelI5jXfT47eIm1/+zZzj0lYUK nflA== X-Gm-Message-State: AOJu0YwrQ6LG5EZ6m//DZLXUUeIml/qDjyxJEf4yswRo8t+ijqbUhATB Dg8gKQGV6SowBpFxzVCIgOQdMtcnAiVlVyhH245reOe11ymzYOrVttlLRL1mpgycm7496b+AdHd / X-Gm-Gg: ASbGncsneFs/acua35eOJjmo6l2hv6q0CajdfO8pxWSfJCfEs629cPA3kDngOlMztmA QrhnnEH2O7ejex3X6CgtzFyN4rpIa+/pKijMhmeNK5ozLeuF8Os2ONX73gnRDa1Zd4WcW5iXwId Dcd4Du/8hoUZBaSNRHKDLjT4X/PTm9Yuo1cd+mgUh40fl2x6sAJ3fM64LTGOLOVU7r0R5CQ6S0V /5Z9aY0EIZr5OvNw5u+TFd+dC1hEmVURzrtLOXxAqBpGp/F+Lmm21oUWqSkNhYxrynFyh2r7eAl GUtD X-Received: by 2002:a5d:64c4:0:b0:386:321e:f124 with SMTP id ffacd0b85a97d-38a1a20e85bmr286357f8f.13.1734546073746; Wed, 18 Dec 2024 10:21:13 -0800 (PST) Received: from localhost.localdomain ([78.196.4.158]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4364a379d69sm54592225e9.0.2024.12.18.10.21.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 18 Dec 2024 10:21:13 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Harsh Prateek Bora , Nicholas Piggin , Daniel Henrique Barboza , "Edgar E. Iglesias" , =?utf-8?q?Daniel_P=2E_Berra?= =?utf-8?q?ng=C3=A9?= , BALATON Zoltan , qemu-ppc@nongnu.org, =?utf-8?q?Marc-An?= =?utf-8?q?dr=C3=A9_Lureau?= , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PATCH v3 1/7] meson: Run some compiler checks using -Wno-unused-value Date: Wed, 18 Dec 2024 19:21:00 +0100 Message-ID: <20241218182106.78800-2-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241218182106.78800-1-philmd@linaro.org> References: <20241218182106.78800-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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=unavailable 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 85f74854735..9d93dcd95d7 100644 --- a/meson.build +++ b/meson.build @@ -1189,7 +1189,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') @@ -2713,7 +2714,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')) @@ -2731,10 +2732,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