6879689: Fix warning about ignored return value when compiling with -O2

Tue, 08 Sep 2009 09:01:16 +0100

author
andrew
date
Tue, 08 Sep 2009 09:01:16 +0100
changeset 1403
5fdbe2cdf565
parent 1353
6ab1d6ece8bd
child 1404
0804a88ed4f5

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

src/share/vm/adlc/archDesc.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/adlc/archDesc.cpp	Mon Aug 17 15:03:39 2009 -0700
     1.2 +++ b/src/share/vm/adlc/archDesc.cpp	Tue Sep 08 09:01:16 2009 +0100
     1.3 @@ -1031,7 +1031,8 @@
     1.4  //---------------------------addSUNcopyright-------------------------------
     1.5  // output SUN copyright info
     1.6  void ArchDesc::addSunCopyright(char* legal, int size, FILE *fp) {
     1.7 -  fwrite(legal, size, 1, fp);
     1.8 +  size_t count = fwrite(legal, 1, size, fp);
     1.9 +  assert(count == (size_t) size, "copyright info truncated");
    1.10    fprintf(fp,"\n");
    1.11    fprintf(fp,"// Machine Generated File.  Do Not Edit!\n");
    1.12    fprintf(fp,"\n");

mercurial