[igt-dev] [PATCH i-g-t] tools/i915-perf: workaround overzelous compiler warnings
Petri Latvala
petri.latvala at intel.com
Thu Feb 20 12:58:39 UTC 2020
On Thu, Feb 20, 2020 at 02:51:52PM +0200, Lionel Landwerlin wrote:
> Give me a break :)
>
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> ---
> tools/i915-perf/i915_perf_control.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/tools/i915-perf/i915_perf_control.c b/tools/i915-perf/i915_perf_control.c
> index a8d0d30f..dcbc2f59 100644
> --- a/tools/i915-perf/i915_perf_control.c
> +++ b/tools/i915-perf/i915_perf_control.c
> @@ -95,10 +95,12 @@ main(int argc, char *argv[])
> struct recorder_command_base base;
> struct recorder_command_dump dump;
> } *data = malloc(total_len);
> + char *path = (char *) data->dump.path;
>
> data->base.command = RECORDER_COMMAND_DUMP;
> data->base.size = total_len;
> - snprintf((char *) data->dump.path, strlen(dump_file) + 1, "%s", dump_file);
> + snprintf(path, strlen(dump_file) + 1, "%s", dump_file);
> +
Same warning still. My compiler is clever enough to see that even with
another pointer indirection, the area pointed at is an array of 0
elements.
--
Petri Latvala
More information about the igt-dev
mailing list