[Gc] boehm-gc patch

Jack Andrews effbiae at gmail.com
Mon Dec 14 03:45:54 PST 2009


hi,

>> --- cord/cordxtra.c   10 Oct 2005 22:33:34 -0000      1.1.1.1
>> +++ cord/cordxtra.c   14 Dec 2009 00:31:33 -0000
>> @@ -574,7 +574,8 @@ CORD CORD_from_file_lazy_inner(FILE * f,
>>       /* world is multithreaded.                      */
>>       char buf[1];
>>
>> -     (void) fread(buf, 1, 1, f);
>> +     /* This `if' construct avoids a warning from GCC. */
>> +     if (fread(buf, 1, 1, f)) { }
>>       rewind(f);
>>      }
>>      state -> lf_file = f;
>
> This is rather horrid.  Do we really care so much about compiler warnings
> that we will put such contorted code into our programs?

if fread() fails, shouldn't there be error handling?

if not, define a macro
  #define IGNORE(x) if(!(x)); /* ignore the result of x*/

ta, jack.



More information about the Gc mailing list