Skip to content
Snippets Groups Projects
Commit f0bb1949 authored by Maarten Lankhorst's avatar Maarten Lankhorst
Browse files

overlay: Fix compiler warning when compiling with recent gcc.


[1/316] Compiling C object 'overlay/intel-gpu-overlay@exe/overlay.c.o'.
../overlay/overlay.c: In function ‘show_gem_objects’:
../overlay/overlay.c:798:31: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 160 [-Wformat-truncation=]
   snprintf(buf, sizeof(buf), "%s %ldMB, %ld objects",
                               ^~
../overlay/overlay.c:798:30: note: using the range [-9223372036854775808, 9223372036854775807] for directive argument
   snprintf(buf, sizeof(buf), "%s %ldMB, %ld objects",
                              ^~~~~~~~~~~~~~~~~~~~~~~
../overlay/overlay.c:798:30: note: using the range [-9223372036854775808, 9223372036854775807] for directive argument
../overlay/overlay.c:798:3: note: ‘snprintf’ output between 16 and 309 bytes into a destination of size 160
   snprintf(buf, sizeof(buf), "%s %ldMB, %ld objects",
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    comm->name, comm->bytes >> 20, comm->count);

Might as well give it the 309 bytes it wants, plus on more. :-)

Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 538091ce
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment