From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
Andi Kleen <ak@linux.intel.com>,
Jin Yao <yao.jin@linux.intel.com>,
John Garry <john.garry@huawei.com>,
Adrian Hunter <adrian.hunter@intel.com>,
linux-kernel@vger.kernel.org,
Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH 2/2] perf parse-events: enable more flex/yacc warnings
Date: Wed, 10 Jun 2020 11:18:17 -0300 [thread overview]
Message-ID: <20200610141817.GM24868@kernel.org> (raw)
In-Reply-To: <20200610140956.GL24868@kernel.org>
Em Wed, Jun 10, 2020 at 11:09:56AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Wed, Jun 10, 2020 at 11:05:26AM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Tue, Jun 09, 2020 at 04:43:44PM -0700, Ian Rogers escreveu:
> > > All C compiler warnings are disabled are disabled by -w. This change
> > > removes the -w from flex and bison targets. To avoid implicit
> > > declarations header files are declared as targets and included.
>
> > > Tested with GCC 9.3.0 and clang 9.0.1.
>
> > > Signed-off-by: Ian Rogers <irogers@google.com>
>
> > > +++ b/tools/perf/util/Build
> <SNIP>
> > > -$(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c
> > > +$(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-flex.h: util/parse-events.l $(OUTPUT)util/parse-events-bison.c
> > > $(call rule_mkdir)
> > > - $(Q)$(call echo-cmd,flex)$(FLEX) -o $@ --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) util/parse-events.l
> > > + $(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/parse-events-flex.c \
> > > + --header-file=$(OUTPUT)util/parse-events-flex.h \
> > > + $(PARSER_DEBUG_FLEX) $<
>
> <SNIP>
>
> > And you took advantage of util/parse-events.l being
> > the first dependency to replace it with $<
>
> <SNIP>
>
> > Damn, Makefiles are obtuse, we better do this more piecemeal, for
> > instance, using $< where applicable first, etc.
>
> I mean, first this, ok? Then you do the other bits, and please try to
> keep the positioning as far as possible, so that visually we see what is
> being replaced by what.
Argh, replace all %< below with, of course, $<
- Arnaldo
>
> diff --git a/tools/perf/util/Build b/tools/perf/util/Build
> index 8d18380ecd10..cc50fdfd0c2f 100644
> --- a/tools/perf/util/Build
> +++ b/tools/perf/util/Build
> @@ -193,27 +193,27 @@ CFLAGS_genelf_debug.o += -Wno-packed
>
> $(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c
> $(call rule_mkdir)
> - $(Q)$(call echo-cmd,flex)$(FLEX) -o $@ --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) util/parse-events.l
> + $(Q)$(call echo-cmd,flex)$(FLEX) -o $@ --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) %<
>
> $(OUTPUT)util/parse-events-bison.c: util/parse-events.y
> $(call rule_mkdir)
> - $(Q)$(call echo-cmd,bison)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $@ -p parse_events_
> + $(Q)$(call echo-cmd,bison)$(BISON) -v %< -d $(PARSER_DEBUG_BISON) -o $@ -p parse_events_
>
> $(OUTPUT)util/expr-flex.c: util/expr.l $(OUTPUT)util/expr-bison.c
> $(call rule_mkdir)
> - $(Q)$(call echo-cmd,flex)$(FLEX) -o $@ --header-file=$(OUTPUT)util/expr-flex.h $(PARSER_DEBUG_FLEX) util/expr.l
> + $(Q)$(call echo-cmd,flex)$(FLEX) -o $@ --header-file=$(OUTPUT)util/expr-flex.h $(PARSER_DEBUG_FLEX) %<
>
> $(OUTPUT)util/expr-bison.c: util/expr.y
> $(call rule_mkdir)
> - $(Q)$(call echo-cmd,bison)$(BISON) -v util/expr.y -d $(PARSER_DEBUG_BISON) -o $@ -p expr_
> + $(Q)$(call echo-cmd,bison)$(BISON) -v %< -d $(PARSER_DEBUG_BISON) -o $@ -p expr_
>
> $(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c
> $(call rule_mkdir)
> - $(Q)$(call echo-cmd,flex)$(FLEX) -o $@ --header-file=$(OUTPUT)util/pmu-flex.h util/pmu.l
> + $(Q)$(call echo-cmd,flex)$(FLEX) -o $@ --header-file=$(OUTPUT)util/pmu-flex.h %<
>
> $(OUTPUT)util/pmu-bison.c: util/pmu.y
> $(call rule_mkdir)
> - $(Q)$(call echo-cmd,bison)$(BISON) -v util/pmu.y -d -o $@ -p perf_pmu_
> + $(Q)$(call echo-cmd,bison)$(BISON) -v %< -d -o $@ -p perf_pmu_
>
> CFLAGS_parse-events-flex.o += -w
> CFLAGS_pmu-flex.o += -w
--
- Arnaldo
next prev parent reply other threads:[~2020-06-10 14:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-09 23:43 [PATCH 1/2] perf pmu: remove unused declaration Ian Rogers
2020-06-09 23:43 ` [PATCH 2/2] perf parse-events: enable more flex/yacc warnings Ian Rogers
2020-06-10 14:05 ` Arnaldo Carvalho de Melo
2020-06-10 14:09 ` Arnaldo Carvalho de Melo
2020-06-10 14:18 ` Arnaldo Carvalho de Melo [this message]
2020-06-10 17:00 ` Ian Rogers
2020-06-10 13:46 ` [PATCH 1/2] perf pmu: remove unused declaration Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200610141817.GM24868@kernel.org \
--to=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=eranian@google.com \
--cc=irogers@google.com \
--cc=john.garry@huawei.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=yao.jin@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).