[PATCH FOR REVIEW]: Fix warning in src/share/vm/adlc/archDesc.cpp
Andrew John Hughes
gnu_andrew at member.fsf.org
Fri Sep 4 16:25:46 PDT 2009
2009/9/4 Paul Hohensee <Paul.Hohensee at sun.com>:
> Try a cast to (void).
>
As I said (or meant to, mental typo), this doesn't fix it. GCC still complains.
> 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?
>>
>
--
Andrew :-)
Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)
Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8
More information about the hotspot-dev
mailing list