Fixed bug 4366 - Compile throws a warning on RPI (Raspbian Stretch)
authorSam Lantinga <slouken@libsdl.org>
Mon, 12 Nov 2018 16:42:49 -0800
changeset 124072a761b9ff83f
parent 12406 d274fa9731b1
child 12408 b590d04d5cf7
Fixed bug 4366 - Compile throws a warning on RPI (Raspbian Stretch)

midwan

When trying to compile on a Raspberry Pi 3, running Raspbian Stretch (fully updated), a warning appears:

/home/pi/projects/SDL/src/test/SDL_test_memory.c: In function ‘SDL_TrackAllocation’:
/home/pi/projects/SDL/src/test/SDL_test_memory.c:112:109: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘unw_word_t {aka unsigned int}’ [-Wformat=]
snprintf(entry->stack_names[stack_index], sizeof(entry->stack_names[stack_index]), "%s+0x%llx", sym, offset);
src/test/SDL_test_memory.c
     1.1 --- a/src/test/SDL_test_memory.c	Mon Nov 12 16:34:58 2018 -0800
     1.2 +++ b/src/test/SDL_test_memory.c	Mon Nov 12 16:42:49 2018 -0800
     1.3 @@ -109,7 +109,7 @@
     1.4              entry->stack[stack_index] = pc;
     1.5  
     1.6              if (unw_get_proc_name(&cursor, sym, sizeof(sym), &offset) == 0) {
     1.7 -                snprintf(entry->stack_names[stack_index], sizeof(entry->stack_names[stack_index]), "%s+0x%llx", sym, offset);
     1.8 +                snprintf(entry->stack_names[stack_index], sizeof(entry->stack_names[stack_index]), "%s+0x%llx", sym, (unsigned long long)offset);
     1.9              }
    1.10              ++stack_index;
    1.11