]> granicus.if.org Git - procps-ng/commit
ps: Output of nwchan is a number
authorCraig Small <csmall@enc.com.au>
Thu, 12 May 2016 10:43:49 +0000 (20:43 +1000)
committerCraig Small <csmall@enc.com.au>
Thu, 12 May 2016 10:43:49 +0000 (20:43 +1000)
commit201208cbc127f99e7643e4a72e6eafbbaa4d5ea8
tree5e5cdd4d9ff5dc1f764b440d3fc8b9cc6f4d866a
parentb4beb162fd4c4a848942b82ed036b447d2c11481
ps: Output of nwchan is a number

For some time with enough compilier flags I have watched the
following warning drift by:
ps/output.c: In function ‘pr_nwchan’:
ps/output.c:658:41: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   return snprintf(outbuf, COLWID, "%x", (unsigned)rSv(WCHAN_NAME, str, pp));

nwchan is supposed to be the address of where the process is sleeping,
not the name. Besides %x is a hex number not a string hence the warning.

nwchan now prints the address, in hex and GCC is happy.
ps/output.c