From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Florian Weimer <fweimer@redhat.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
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@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
"Justin M. Forbes" <jforbes@fedoraproject.org>
Subject: Re: [PATCH v2] perf: Avoid implicit function declarations in lexer/parse interface
Date: Fri, 28 Apr 2023 22:34:25 -0300 [thread overview]
Message-ID: <ZEx0IQAtBatrRDCR@kernel.org> (raw)
In-Reply-To: <CAP-5=fXZv+KCdCN05wVUcAwDCZAgXjWunoaviGBQEiUPqNwOmg@mail.gmail.com>
Em Tue, Apr 25, 2023 at 10:40:14AM -0700, Ian Rogers escreveu:
> On Tue, Apr 25, 2023 at 10:12 AM Florian Weimer <fweimer@redhat.com> wrote:
> >
> > In future compilers, -Wno-implicit-function-declaration may not bring
> > back support for implicit function declarations, a feature that was
> > removed from the C language in C99. Instead of relying on implicit
> > declarations, include the flex-generated header from the
> > bison-generated C code.
> >
> > he expr-flex.h header needs to be included later than the others
>
> nit: s/he/The/
>
> > because at the early point, the definition of YYSTYPE is not yet
> > available.
> >
> > Signed-off-by: Florian Weimer <fweimer@redhat.com>
>
> Acked-by: Ian Rogers <irogers@google.com>
>
> Thanks for fighting the build wrt parallel dependencies!
> Ian
Thanks, applied. BTW b4 coulnd't find this message (nor the original):
⬢[acme@toolbox perf-tools-next]$ b4 am -ctsl --cc-trailers 87sfcn7uot.fsf@oldenburg.str.redhat.com
Grabbing thread from lore.kernel.org/all/87sfcn7uot.fsf%40oldenburg.str.redhat.com/t.mbox.gz
That message-id is not known.
⬢[acme@toolbox perf-tools-next]$ b4 am -ctsl --cc-trailers CAP-5=fXZv+KCdCN05wVUcAwDCZAgXjWunoaviGBQEiUPqNwOmg@mail.gmail.com
Grabbing thread from lore.kernel.org/all/CAP-5%3DfXZv%2BKCdCN05wVUcAwDCZAgXjWunoaviGBQEiUPqNwOmg%40mail.gmail.com/t.mbox.gz
Analyzing 1 messages in the thread
No patches found.
⬢[acme@toolbox perf-tools-next]$
I applied it in the old fashion.
- Arnaldo
> > ---
> > v2: Include the flex-generated files instead of manually-written prototypes.
> >
> > tools/perf/util/Build | 10 +++++++++-
> > tools/perf/util/expr.y | 2 ++
> > tools/perf/util/parse-events.y | 1 +
> > tools/perf/util/pmu.y | 1 +
> > 4 files changed, 13 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/perf/util/Build b/tools/perf/util/Build
> > index 918b501f9bd8..92897068c362 100644
> > --- a/tools/perf/util/Build
> > +++ b/tools/perf/util/Build
> > @@ -283,7 +283,7 @@ CFLAGS_expr-flex.o += $(flex_flags)
> > bison_flags := -DYYENABLE_NLS=0
> > BISON_GE_35 := $(shell expr $(shell $(BISON) --version | grep bison | sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\)/\1\2/g') \>\= 35)
> > ifeq ($(BISON_GE_35),1)
> > - bison_flags += -Wno-unused-parameter -Wno-nested-externs -Wno-implicit-function-declaration -Wno-switch-enum -Wno-unused-but-set-variable -Wno-unknown-warning-option
> > + bison_flags += -Wno-unused-parameter -Wno-nested-externs -Wno-switch-enum -Wno-unused-but-set-variable -Wno-unknown-warning-option
> > else
> > bison_flags += -w
> > endif
> > @@ -340,3 +340,11 @@ $(OUTPUT)util/vsprintf.o: ../lib/vsprintf.c FORCE
> > $(OUTPUT)util/list_sort.o: ../lib/list_sort.c FORCE
> > $(call rule_mkdir)
> > $(call if_changed_dep,cc_o_c)
> > +
> > +# These dependencies ensure that the flex-generated .h file is
> > +# available at the time the bison-generated .c sources are compiled.
> > +# Do not depend on the generated .h file to prevent triggering
> > +# parallel flex invocations for the same two output files.
> > +$(OUTPUT)util/expr-bison.o : $(OUTPUT)util/expr-flex.c
> > +$(OUTPUT)util/parse-events-bison.o : $(OUTPUT)util/parse-events-flex.c
> > +$(OUTPUT)util/pmu-bison.o : $(OUTPUT)util/pmu-flex.c
> > diff --git a/tools/perf/util/expr.y b/tools/perf/util/expr.y
> > index 635e562350c5..99581193ca4c 100644
> > --- a/tools/perf/util/expr.y
> > +++ b/tools/perf/util/expr.y
> > @@ -53,6 +53,8 @@
> > %destructor { ids__free($$.ids); } <ids>
> >
> > %{
> > +#include "expr-flex.h"
> > +
> > static void expr_error(double *final_val __maybe_unused,
> > struct expr_parse_ctx *ctx __maybe_unused,
> > bool compute_ids __maybe_unused,
> > diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
> > index be8c51770051..67a7f70c4767 100644
> > --- a/tools/perf/util/parse-events.y
> > +++ b/tools/perf/util/parse-events.y
> > @@ -17,6 +17,7 @@
> > #include "evsel.h"
> > #include "parse-events.h"
> > #include "parse-events-bison.h"
> > +#include "parse-events-flex.h"
> >
> > void parse_events_error(YYLTYPE *loc, void *parse_state, void *scanner, char const *msg);
> >
> > diff --git a/tools/perf/util/pmu.y b/tools/perf/util/pmu.y
> > index e675d79a0274..2170f1ac7b74 100644
> > --- a/tools/perf/util/pmu.y
> > +++ b/tools/perf/util/pmu.y
> > @@ -9,6 +9,7 @@
> > #include <linux/bitmap.h>
> > #include <string.h>
> > #include "pmu.h"
> > +#include "pmu-flex.h"
> >
> > #define ABORT_ON(val) \
> > do { \
> >
> > base-commit: 173ea743bf7a9eef04460e03b00ba267cc52aee2
> >
--
- Arnaldo
next prev parent reply other threads:[~2023-04-29 1:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87sfcn7uot.fsf@oldenburg.str.redhat.com>
2023-04-25 17:40 ` [PATCH v2] perf: Avoid implicit function declarations in lexer/parse interface Ian Rogers
2023-04-29 1:34 ` Arnaldo Carvalho de Melo [this message]
2023-04-29 1:37 ` Arnaldo Carvalho de Melo
2023-05-03 9:36 ` Florian Weimer
2023-05-03 9:40 ` Florian Weimer
2023-05-03 15:04 ` Arnaldo Carvalho de Melo
2023-05-03 15:28 ` Ian Rogers
2023-05-03 16:45 ` Florian Weimer
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=ZEx0IQAtBatrRDCR@kernel.org \
--to=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=fweimer@redhat.com \
--cc=irogers@google.com \
--cc=jforbes@fedoraproject.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/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).