From nobody Mon Feb 9 13:01:14 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8473C001DE for ; Fri, 28 Jul 2023 06:50:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233709AbjG1GuZ (ORCPT ); Fri, 28 Jul 2023 02:50:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233683AbjG1GuL (ORCPT ); Fri, 28 Jul 2023 02:50:11 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 459ADE64 for ; Thu, 27 Jul 2023 23:49:55 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-d27ac992539so366192276.3 for ; Thu, 27 Jul 2023 23:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690526994; x=1691131794; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=Kv5zMq7Gf+E/mq3KI9mmBvkyfhWn6r0mf6FnCBupmRU=; b=l4MYYbki/hukDreSiqPgSSi7kqT1I0MQAIIMZIRxKVi/gAKLP++vvsd3ohOTx5Peii fqJRbuy+r7VsxO2l6XzHudVyls1bul7gFWrwlg4Rytz7DH8HyH9gSFhKJaR9boqxH5vf tQfuU5hcGl/o9sWuVE9WVfiAGOTqTKTExEQBqUE387gTXbEcKWPa8knk8egaau1z8RJ5 vo6VhoZfucWIvZZld14uFMpRpXPex78nOuYY+HlH6yuU4IhsIMPIUUG5/GjQBsL95wLy W8JKCHqR1HtA8ERSKiqVL7z9rAR1bnYFcooC/jmcbIeA1w6HhuY7zkKABT+erQaA7juD 1jeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690526994; x=1691131794; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Kv5zMq7Gf+E/mq3KI9mmBvkyfhWn6r0mf6FnCBupmRU=; b=HjmpuP/7dmEOs90Tdew5LozrBOnhcuU0ExIFyc2AcyQt+ot+gAw5BoEgrOSc12TIPV PO6gcJY+h2v8oDskH3NAcdTNbHNx5PxgqovoHdmQvXDAOwLfSIJQj/7OuLlLYNLbml9k KXAzxcol42bv+sHgDp5tb8rDs5TjZPdCXc0hEO9bztRBM2Ussh7IZFiO84kuw6xSqEOx UVIHgHGD4YZsqtQVRWoYy7dinpBwZaS814NTheNd1CB8Rba+VXKyLW4J79I/qmeswuzL spDrcPsv0NdVQper6QgbOGJ8fdKdQy9lMt8pebDIZUEbkKooEils7yBU+v9yVt9YkM0n mv4w== X-Gm-Message-State: ABy/qLY4YVRPluAWf7rbyhBD5h6jlm0XiohQuweg3mJgkW/u30XO0F8e VEPvNW3LUuZK+XDKT3AUFgW3J3nj7RfB X-Google-Smtp-Source: APBJJlHSjc/IT1qlh3DupBROZRiA34CttLjbZ/ikQplvXR7TLxlgSKa9DNC7fbAHgw/FKUsK9regMJwIlwEM X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:3d03:ff18:af30:2dad]) (user=irogers job=sendgmr) by 2002:a25:d613:0:b0:d12:d6e4:a08d with SMTP id n19-20020a25d613000000b00d12d6e4a08dmr4686ybg.7.1690526993885; Thu, 27 Jul 2023 23:49:53 -0700 (PDT) Date: Thu, 27 Jul 2023 23:49:16 -0700 In-Reply-To: <20230728064917.767761-1-irogers@google.com> Message-Id: <20230728064917.767761-6-irogers@google.com> Mime-Version: 1.0 References: <20230728064917.767761-1-irogers@google.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog Subject: [PATCH v1 5/6] perf build: Disable fewer bison warnings From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Nathan Chancellor , Nick Desaulniers , Tom Rix , Kan Liang , Eduard Zingerman , Andrii Nakryiko , Gaosheng Cui , Rob Herring , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, llvm@lists.linux.dev Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If bison is version 3.8.2, reduce the number of bison C warnings disabled. Earlier bison versions have all C warnings disabled. Avoid implicit declarations of yylex by adding the declaration in the C file. A header can't be included as a circular dependency would occur due to the lexer using the bison defined tokens. Signed-off-by: Ian Rogers --- tools/perf/util/Build | 6 +++--- tools/perf/util/bpf-filter.y | 2 ++ tools/perf/util/expr.y | 4 +++- tools/perf/util/parse-events.y | 1 + tools/perf/util/pmu.y | 3 +++ 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/Build b/tools/perf/util/Build index 32239c4b0393..20aa8545b127 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build @@ -291,9 +291,9 @@ CFLAGS_expr-flex.o +=3D $(flex_flags) CFLAGS_bpf-filter-flex.o +=3D $(flex_flags) =20 bison_flags :=3D -DYYENABLE_NLS=3D0 -BISON_GE_35 :=3D $(shell expr $(shell $(BISON) --version | grep bison | se= d -e 's/.\+ \([0-9]\+\).\([0-9]\+\)/\1\2/g') \>\=3D 35) -ifeq ($(BISON_GE_35),1) - bison_flags +=3D -Wno-unused-parameter -Wno-nested-externs -Wno-implicit= -function-declaration -Wno-switch-enum -Wno-unused-but-set-variable -Wno-un= known-warning-option +BISON_GE_382 :=3D $(shell expr $(shell $(BISON) --version | grep bison | s= ed -e 's/.\+ \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \>\=3D 382) +ifeq ($(BISON_GE_382),1) + bison_flags +=3D -Wno-switch-enum else bison_flags +=3D -w endif diff --git a/tools/perf/util/bpf-filter.y b/tools/perf/util/bpf-filter.y index 07d6c7926c13..5dfa948fc986 100644 --- a/tools/perf/util/bpf-filter.y +++ b/tools/perf/util/bpf-filter.y @@ -9,6 +9,8 @@ #include #include "bpf-filter.h" =20 +int perf_bpf_filter_lex(void); + static void perf_bpf_filter_error(struct list_head *expr __maybe_unused, char const *msg) { diff --git a/tools/perf/util/expr.y b/tools/perf/util/expr.y index dd504afd8f36..65d54a6f29ad 100644 --- a/tools/perf/util/expr.y +++ b/tools/perf/util/expr.y @@ -7,6 +7,8 @@ #include "util/debug.h" #define IN_EXPR_Y 1 #include "expr.h" +#include "expr-bison.h" +int expr_lex(YYSTYPE * yylval_param , void *yyscanner); %} =20 %define api.pure full @@ -56,7 +58,7 @@ static void expr_error(double *final_val __maybe_unused, struct expr_parse_ctx *ctx __maybe_unused, bool compute_ids __maybe_unused, - void *scanner, + void *scanner __maybe_unused, const char *s) { pr_debug("%s\n", s); diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y index 454577f7aff6..251b7d2fde32 100644 --- a/tools/perf/util/parse-events.y +++ b/tools/perf/util/parse-events.y @@ -20,6 +20,7 @@ #include "parse-events.h" #include "parse-events-bison.h" =20 +int parse_events_lex(YYSTYPE * yylval_param, YYLTYPE * yylloc_param , void= *yyscanner); void parse_events_error(YYLTYPE *loc, void *parse_state, void *scanner, ch= ar const *msg); =20 #define PE_ABORT(val) \ diff --git a/tools/perf/util/pmu.y b/tools/perf/util/pmu.y index dff4e892ac4d..3d46cca3bb94 100644 --- a/tools/perf/util/pmu.y +++ b/tools/perf/util/pmu.y @@ -11,6 +11,9 @@ #include #include #include "pmu.h" +#include "pmu-bison.h" + +int perf_pmu_lex(YYSTYPE * yylval_param , void *yyscanner); =20 #define ABORT_ON(val) \ do { \ --=20 2.41.0.487.g6d72f3e995-goog