[patch] Fix compiler warnings throughout

Corinna Vinschen vinschen@redhat.com
Fri Aug 17 13:36:00 GMT 2012

Hi Richard,

On Aug 10 10:00, Richard Earnshaw wrote:
> On 08/08/12 12:04, Corinna Vinschen wrote:
> > Hi,
> > 
> > I just applied the below patch.  The idea was to be able to compile
> > newlib with gcc options set to -Wall -Werror to better support porting
> > to new targets.  So the below patch fixes all problems which showed up
> > when running with these options, like uninitialized variables, suggested
> > parenthesis and braces, as well as real bug which was only uncovered by
> > using these options in freopen.c
> > 
> > Please have a look if something is broken for your target now.  I don't
> > think so, but still...
> > 
> On arm-eabi this causes:
> /work/rearnsha/gnu/trunk/./gcc/xgcc -B/work/rearnsha/gnu/trunk/./gcc/ -nostdinc -B/work/rearnsha/gnu/trunk/arm-eabi/thumb/newlib/ -isystem /work/rearnsha/gnu/trunk/arm-eabi/thumb/newlib/targ-include -isystem /home/rearnsha/gnusrc/gcc-cross/trunk/newlib/libc/include -B/work/rearnsha/gnu/trunk/arm-eabi/thumb/libgloss/arm -L/work/rearnsha/gnu/trunk/arm-eabi/thumb/libgloss/libnosys -L/home/rearnsha/gnusrc/gcc-cross/trunk/libgloss/arm -B/work/rearnsha/gnu/trunk/testinstall/arm-eabi/bin/ -B/work/rearnsha/gnu/trunk/testinstall/arm-eabi/lib/ -isystem /work/rearnsha/gnu/trunk/testinstall/arm-eabi/include -isystem /work/rearnsha/gnu/trunk/testinstall/arm-eabi/sys-include -L/work/rearnsha/gnu/trunk/./ld  -mthumb -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"1.20.0\" -DPACKAGE_STRING=\"newlib\ 1.20.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. -I/home/rearnsha/gnusrc/gcc-cross/trunk/newlib/libc/stdio -DARM_RDI_MONITOR -fno-builtin      -g -O2  -mthumb -fshort-en
> ums -DSTRING_ONLY -c /home/rearnsha/gnusrc/gcc-cross/trunk/newlib/libc/stdio/vfwprintf.c -o lib_a-svfwprintf.o
> /home/rearnsha/gnusrc/gcc-cross/trunk/newlib/libc/stdio/vfwprintf.c: In function '_svfiwprintf_r':
> /home/rearnsha/gnusrc/gcc-cross/trunk/newlib/libc/stdio/vfwprintf.c:643:16: error: 'state' undeclared (first use in this function)
>        memset (&state, '\0', sizeof (state));
>                 ^
> This particular instance is not guarded by FLOATING_POINT being defined.

Thanks for the info.  I just applied a patch.  Does it work for you now?


Corinna Vinschen
Cygwin Project Co-Leader
Red Hat

More information about the Newlib mailing list