[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAP-5=fWnsyE07MD8oAYa8cXGsxD7sP6j3B4voBj2Gj5y44AHtQ@mail.gmail.com>
Date: Wed, 10 Jun 2020 10:00:47 -0700
From: Ian Rogers <irogers@...gle.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Andi Kleen <ak@...ux.intel.com>,
Jin Yao <yao.jin@...ux.intel.com>,
John Garry <john.garry@...wei.com>,
Adrian Hunter <adrian.hunter@...el.com>,
LKML <linux-kernel@...r.kernel.org>,
Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 2/2] perf parse-events: enable more flex/yacc warnings
On Wed, Jun 10, 2020 at 7:18 AM Arnaldo Carvalho de Melo
<acme@...nel.org> wrote:
>
> 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@...gle.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, $<
Thanks, I'll pull it into a series of changes. I'm more worried that
the -W flags aren't going to be supported by an old clang or GCC.
Worth the pain to get rid of the -w that introduced some issues.
Ian
> - 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
Powered by blists - more mailing lists