Test if compiler supports -Wpointer-arith. Fix one warning.

This commit is contained in:
Erik de Castro Lopo 2006-07-25 22:02:22 +00:00
parent 8f9e971705
commit ce4f5ba1ad
3 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2006-07-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* 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 <erikd AT mega-nerd DOT com>
* examples/sndfile-play.c

View File

@ -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"

View File

@ -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 ;