Quell compiler warning. #223

Merged
merged 1 commit into from Apr 15, 2014

Conversation

Projects
None yet
2 participants
Contributor

troth commented Apr 15, 2014

Building on a 32-bit linux system was generating the following:

src/st-info.c: In function ‘print_data’:
src/st-info.c:25:3: warning: format ‘%lx’ expects argument of type
‘long unsigned int’, but argument 2 has type ‘size_t’ [-Wformat]
src/st-info.c:27:3: warning: format ‘%lx’ expects argument of type
‘long unsigned int’, but argument 2 has type ‘size_t’ [-Wformat]
src/st-info.c:29:3: warning: format ‘%lx’ expects argument of type
‘long unsigned int’, but argument 2 has type ‘size_t’ [-Wformat]

Using '%zx' eliminates the warning in a platform agnostic way.

Quell compiler warning.
Building on a 32-bit linux system was generating the following:

  src/st-info.c: In function ‘print_data’:
  src/st-info.c:25:3: warning: format ‘%lx’ expects argument of type \
       ‘long unsigned int’, but argument 2 has type ‘size_t’ [-Wformat]
  src/st-info.c:27:3: warning: format ‘%lx’ expects argument of type \
       ‘long unsigned int’, but argument 2 has type ‘size_t’ [-Wformat]
  src/st-info.c:29:3: warning: format ‘%lx’ expects argument of type \
       ‘long unsigned int’, but argument 2 has type ‘size_t’ [-Wformat]

Using '%zx' eliminates the warning in a platform agnostic way.

texane added a commit that referenced this pull request Apr 15, 2014

@texane texane merged commit a8eb82e into texane:master Apr 15, 2014

@troth troth deleted the troth:troth/fix-compiler-warning-32bit branch Apr 15, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment