lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YUJjzr8lvelSKET1@kernel.org>
Date:   Wed, 15 Sep 2021 18:21:18 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Ian Rogers <irogers@...gle.com>
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>,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>
Subject: Re: [PATCH] perf parse-events: Avoid enum forward declaration.

Em Wed, Sep 15, 2021 at 02:14:28PM -0700, Ian Rogers escreveu:
> Enum forward declarations aren't allowed as the size can't be implied.
> Switch to just using an int. This fixes a clang warning:
> 
> In file included from tools/perf/bench/evlist-open-close.c:13:
> tools/perf/bench/../util/parse-events.h:185:6: error: redeclaration of already-defined enum 'perf_tool_event' is a GNU extension [-Werror,-Wgnu-redeclared-enum]
> enum perf_tool_event;
>      ^
> tools/perf/bench/../util/evsel.h:28:6: note: previous definition is here
> enum perf_tool_event {
>      ^

Thanks, applied.

- Arnaldo

 
> Signed-off-by: Ian Rogers <irogers@...gle.com>
> ---
>  tools/perf/util/parse-events.c | 2 +-
>  tools/perf/util/parse-events.h | 3 +--
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
> index 51a2219df601..5d1346aa0627 100644
> --- a/tools/perf/util/parse-events.c
> +++ b/tools/perf/util/parse-events.c
> @@ -1471,7 +1471,7 @@ int parse_events_add_numeric(struct parse_events_state *parse_state,
>  
>  int parse_events_add_tool(struct parse_events_state *parse_state,
>  			  struct list_head *list,
> -			  enum perf_tool_event tool_event)
> +			  int tool_event)
>  {
>  	return add_event_tool(list, &parse_state->idx, tool_event);
>  }
> diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
> index bf6e41aa9b6a..b32ed3064c49 100644
> --- a/tools/perf/util/parse-events.h
> +++ b/tools/perf/util/parse-events.h
> @@ -182,10 +182,9 @@ int parse_events_add_numeric(struct parse_events_state *parse_state,
>  			     struct list_head *list,
>  			     u32 type, u64 config,
>  			     struct list_head *head_config);
> -enum perf_tool_event;
>  int parse_events_add_tool(struct parse_events_state *parse_state,
>  			  struct list_head *list,
> -			  enum perf_tool_event tool_event);
> +			  int tool_event);
>  int parse_events_add_cache(struct list_head *list, int *idx,
>  			   char *type, char *op_result1, char *op_result2,
>  			   struct parse_events_error *error,
> -- 
> 2.33.0.309.g3052b89438-goog

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ