Re: [RFC PATCH] perf: parse-events: Fix compilation error while defining DEBUG_PARSER

From: Namhyung Kim
Date: Thu Jun 06 2024 - 13:13:02 EST


On Wed, 05 Jun 2024 16:04:53 +0200, Clément Le Goffic wrote:

> Compiling perf tool with 'DEBUG_PARSER=1' leads to errors:
>
> $> make -C tools/perf PARSER_DEBUG=1 NO_LIBTRACEEVENT=1
> ...
> CC util/expr-flex.o
> CC util/expr.o
> util/parse-events.c:33:12: error: redundant redeclaration of ‘parse_events_debug’ [-Werror=redundant-decls]
> 33 | extern int parse_events_debug;
> | ^~~~~~~~~~~~~~~~~~
> In file included from util/parse-events.c:18:
> util/parse-events-bison.h:43:12: note: previous declaration of ‘parse_events_debug’ with type ‘int’
> 43 | extern int parse_events_debug;
> | ^~~~~~~~~~~~~~~~~~
> util/expr.c:27:12: error: redundant redeclaration of ‘expr_debug’ [-Werror=redundant-decls]
> 27 | extern int expr_debug;
> | ^~~~~~~~~~
> In file included from util/expr.c:11:
> util/expr-bison.h:43:12: note: previous declaration of ‘expr_debug’ with type ‘int’
> 43 | extern int expr_debug;
> | ^~~~~~~~~~
> cc-1: all warnings being treated as errors
>
> [...]

Applied to perf-tools-next, thanks!


Best regards,
Namhyung