[Mimedefang] putc failed: Error 0 line 848 - revisited

Alberto.daSilva at rmb.co.za Alberto.daSilva at rmb.co.za
Wed Dec 11 16:14:00 EST 2002


>How about changing:
>          if (putc(*s, data->fp) == EOF)
>to:
>          if ( ((int) putc(*s, data->fp))  == (int) EOF)
>Give that a shot and let me know.

Tried this - still broken using "gcc 3.2 -O2".

I've tried various compilers with the original code.

gcc 2.95.3 -O2 - works (all optimizations)
gcc 3.2    -O1 - works
gcc 3.2.1  -O1 - works
gcc 3.2    -O2 - broken
gcc 3.2.1  -O2 - broken
Forte 7   -xO2 - works (all optimizations)

I suspect it's a gcc problem because:
     using "gcc 3.2 -O1" works and
     using "gcc 3.2 -O2" breaks

Changing the optimization level should only affect the speed, not the
logic.

Interestingly the assembler code from "gcc 3.2 -O1"
looks very much like "gcc 2.95.3 -O2".

I tried "gcc -save-temps"
     if (putc(*s, data->fp) == EOF)
expands to
     if ((--(data->fp)->_cnt < 0 ? __flsbuf((*s), (data->fp)) : (int)
(*(data->fp)->_ptr++ = (unsigned char) (*s))) == (-1)) {
which looks fine.

Probably the correct procedure would be to report this on
     http://www.gnu.org/software/gcc/bugs.html

I guess I'll have to stick with gcc 2.95.3 (or Forte 7).

Thanks

Alberto




More information about the MIMEDefang mailing list