[PATCH FOR REVIEW]: Fix warning in src/share/vm/adlc/archDesc.cpp

Paul Hohensee Paul.Hohensee at Sun.COM
Fri Sep 4 15:41:52 PDT 2009


Try a cast to (void).

Paul

Andrew John Hughes wrote:
> If HotSpot is built with gcc 4.4 and CFLAGS contains -O2, it fails
> with the following warning (due to -Werror):
>
> g++ -DLINUX -D_GNU_SOURCE -DAMD64
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/asm
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/ci
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/classfile
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/code
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/compiler
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/gc_implementation
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/gc_implementation/g1
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/gc_implementation/parallelScavenge
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/gc_implementation/parNew
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/gc_implementation/shared
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/gc_interface
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/interpreter
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/libadt
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/memory
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/oops
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/opto
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/prims
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/runtime
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/services
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/shark
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/utilities
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/cpu/x86/vm
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/os/linux/vm
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/os_cpu/linux_x86/vm
> -I/mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/adlc
> -I../generated -DASSERT -g -O2 -DCOMPILER2  -fno-rtti -fno-exceptions
> -D_REENTRANT -fcheck-new -m64 -pipe -g -DCOMPILER2  -fno-rtti
> -fno-exceptions -D_REENTRANT -fcheck-new -m64 -pipe -g -Werror -c -o
> ../generated/adfiles/archDesc.o
> /mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/adlc/archDesc.cpp
> cc1plus: warnings being treated as errors
> /mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/adlc/archDesc.cpp:
> In member function 'void ArchDesc::addSunCopyright(char*, int,
> FILE*)':
> /mnt/builder/icedtea7/openjdk-ecj/hotspot/src/share/vm/adlc/archDesc.cpp:1034:
> error: ignoring return value of 'size_t fwrite(const void*, size_t,
> size_t, FILE*)', declared with attribute warn_unused_result
>
> The webrev:
>
> http://cr.openjdk.java.net/~andrew/werror/webrev.01/
>
> fixes this by storing the result (I tried a simple cast to (void*) but
> gcc wasn't happy with this).
>
> Ok to commit?
>   


More information about the hotspot-dev mailing list