AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

1999.02.25 13:57 "Re: Pb with LZW", by Peter Nielsen
1999.02.25 15:10 "Re: Pb with LZW", by Peter Nielsen
1999.02.25 15:22 "Re: Pb with LZW", by Tom Lane

1999.02.25 15:10 "Re: Pb with LZW", by Peter Nielsen

>>Microsoft, on the other hand has redefined the standard and
>>the manual says that the result is "undefined" if all bits
>>are shifted out.
>
>Microsoft are right. ANSI C says
>
>"If the value of the right operand is greater than or equal to the width in
>bits of the promoted left operand, the behaviour is undefined."

Hmm... I admit that I didn't check what ANSI C says since we were interested in what the correct behaviour for C++ is. I think Bjarne Stroustrup defines the result as zero in one of his books, but correct me if I'm wrong. What does the 1998 ANSI C++ standard say?

Best regards,
        Peter