This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: bits/string2.h


>>>>> Bill Wendling writes:

 > Hi all,
 > Question here: I'm running gcc-2.95.2. When I try to compile something
 > using the string functions, gcc uses the macros in include/bits/string2.h
 > to optimize them, however, I get tons of warning messages like this:

 > /usr/include/bits/string2.h: In function `__strcpy_small':
 > /usr/include/bits/string2.h:419: warning: pointer of type `void *' used
 > in arithmetic

 > Here's the compile line:

 > gcc -g -O2 -Wall -W -Wshadow -Wpointer-arith -Wbad-function-cast
 > -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes
 > -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -O
 > -I. -I../../hdf5-1.2.2-snap1/test -I../src -I../../hdf5-1.2.2-snap1/src
 > -I/home/wendling/dev/NewHDF/include -DNDEBUG -UH5_DEBUG_API -c -fPIC
 > -DPIC stab.c

 > Is there something I'm doing wrong? Is there a commandline option I could
 > give it to stop these warnings?
That's a bug in gcc which is already fixed in the current development
version of gcc 2.96.  Either don't use -Wpointer-arith or disable the
the inline macros if you don't like the warnings.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]