freebsd-skq/usr.bin/hexdump
johan f895222e81 display.c:
- 'savech' is only used if it is set a few lines above where
	  it is used, initialize it to silence warning.

	- 'length' is either -1 or greater than 0, hence it is safe to cast it
	  to unsigned when comparing it here.

odsyntax.c:
	- 'p' is assigned either (*argvp)[0] or (*argvp)[1] which both are
	  char *. 'num' and 'end' are assigned values based on 'p'.
	  Hence use char * instead of unsigned char * for these variables.

	  '&end' as the second argument to strtoll does not need to be casted
	  to char** any more.

	  This solves a
	  'dereferencing type-punned pointer will break strict-aliasing rules'
	  warning when compiling with -O2.

parse.c:
	- 'prec' is only used when sokay == USEPREC and sokay = USEPREC
	  when 'prec' is assigned. Hence 'prec' is not used uninitialized,
	  initialize it to silence warning.

	- The code involving 'nextpr' is hard to follow, but I belive
	  'nextpr' will not be used unless it is initialized.
	  Anyway, IF 'nextpr' is used uninitialized it is better to
	  get a consistant error (seg fault, when dereferencing a NULL pointer)
	  than potentially accessing some random memory.

The above changes makes hexdump WARNS=6 clean even when compiled with
-O2. Hence bump WARNS to keep it clean.

Tested by:	CFLAGS='-O2 -pipe' make universe
2004-07-22 13:14:42 +00:00
..
conv.c Include <string.h> to get memset and strcmp prototype. 2004-07-16 11:07:07 +00:00
display.c display.c: 2004-07-22 13:14:42 +00:00
hexdump.1 Add a reference to od(1). 2004-07-10 13:11:00 +00:00
hexdump.c ANSIify function definitions. 2002-09-04 23:29:10 +00:00
hexdump.h Add POSIX-style support for multibyte characters to od(1): the 'c' 2004-07-11 01:11:12 +00:00
hexsyntax.c ANSIify function definitions. 2002-09-04 23:29:10 +00:00
Makefile display.c: 2004-07-22 13:14:42 +00:00
od.1 Add POSIX-style support for multibyte characters to od(1): the 'c' 2004-07-11 01:11:12 +00:00
odsyntax.c display.c: 2004-07-22 13:14:42 +00:00
parse.c display.c: 2004-07-22 13:14:42 +00:00