# HG changeset patch # User andrew # Date 1252396876 -3600 # Node ID 5fdbe2cdf565f5d2c5c6bc8686a8eb792903e30e # Parent 6ab1d6ece8bd7e0fb9bc16c2a1e03ca6b5402426 6879689: Fix warning about ignored return value when compiling with -O2 Summary: Store the return value of fwrite and check it matches the size of the array. Reviewed-by: twisti, dholmes diff -r 6ab1d6ece8bd -r 5fdbe2cdf565 src/share/vm/adlc/archDesc.cpp --- a/src/share/vm/adlc/archDesc.cpp Mon Aug 17 15:03:39 2009 -0700 +++ b/src/share/vm/adlc/archDesc.cpp Tue Sep 08 09:01:16 2009 +0100 @@ -1031,7 +1031,8 @@ //---------------------------addSUNcopyright------------------------------- // output SUN copyright info void ArchDesc::addSunCopyright(char* legal, int size, FILE *fp) { - fwrite(legal, size, 1, fp); + size_t count = fwrite(legal, 1, size, fp); + assert(count == (size_t) size, "copyright info truncated"); fprintf(fp,"\n"); fprintf(fp,"// Machine Generated File. Do Not Edit!\n"); fprintf(fp,"\n");