diff --git a/ChangeLog b/ChangeLog index f7a3aa66..447beed4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-07-26 Erik de Castro Lopo + + * configure.ac + Test if compiler supports -Wpointer-arith. + + * src/common.c + Fix a warning resulting from -Wpointer-arith. + 2006-07-15 Erik de Castro Lopo * examples/sndfile-play.c diff --git a/configure.ac b/configure.ac index ad799b85..6b424fd9 100644 --- a/configure.ac +++ b/configure.ac @@ -411,6 +411,7 @@ if test x$ac_cv_c_compiler_gnu = xyes ; then CFLAGS="$CFLAGS -W -Wall" AC_ADD_CFLAGS(-Wdeclaration-after-statement) + AC_ADD_CFLAGS(-Wpointer-arith) if test x$enable_gcc_werror = "xyes" ; then CFLAGS="-Werror $CFLAGS" diff --git a/src/common.c b/src/common.c index fa0f4f7b..ae2689bd 100644 --- a/src/common.c +++ b/src/common.c @@ -812,7 +812,7 @@ header_read (SF_PRIVATE *psf, void *ptr, int bytes) most = SIGNED_SIZEOF (psf->header) - psf->headindex ; psf_fread (psf->header + psf->headend, 1, most, psf) ; - memset (ptr + most, 0, bytes - most) ; + memset ((char *) ptr + most, 0, bytes - most) ; psf_fseek (psf, bytes - most, SEEK_CUR) ; return bytes ;