Closed eribertomota closed 6 years ago
The following warnings will be fixed:
display.c: In function ‘get_number’:
display.c:309:42: warning: format ‘%llx’ expects argument of type ‘long long unsigned int *’, but argument 3 has type ‘off_t * {aka long int *}’ [-Wformat=]
err = sscanf(tmp + strlen("0x"), "%llx", i);
~~~^
%lx
display.c:311:27: warning: format ‘%lld’ expects argument of type ‘long long int *’, but argument 3 has type ‘off_t * {aka long int *}’ [-Wformat=]
err = sscanf(tmp, "%lld", i);
~~~^
%ld
Thanks
Hum, "i" is type INT = off_t. So changing to "l" will fail on 32 bits where long is 32 bits but off_t is 64 bits (afaik). I'd rather add an explicit cast to (long long unsigned) so silence the warning.
2017-09-14 11:47 GMT-03:00 Pascal Rigaux notifications@github.com:
Hum, "i" is type INT = off_t. So changing to "l" will fail on 32 bits where long is 32 bits but off_t is 64 bits (afaik). I'd rather add an explicit cast to (long long unsigned) so silence the warning.
You are right. Thanks.
I am closing this pull request. Thanks.
This commit will fix two warnings '[-Wformat=]' when building.
This pull request will solve #3