Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcvax!inria!shapiro From: shapiro@inria.UUCP (Marc Shapiro) Newsgroups: comp.lang.c++ Subject: C++ inline bug ==> stream bug Message-ID: <444@inria.UUCP> Date: Wed, 22-Apr-87 14:24:38 EST Article-I.D.: inria.444 Posted: Wed Apr 22 14:24:38 1987 Date-Received: Fri, 24-Apr-87 23:39:10 EST Organization: INRIA, Rocquencourt. France Lines: 53 This bug is notified by Philippe Gautron (mcvax!inria!corto!gautron): Subject: C++ bug (and stream bug) Bjarne, Is the follow bug known? --- struct streambuf{ overflow ( int c = -1 ); inline sputc ( int c = -1 ){ int i = c & 0377; } inline another_sputc ( int c = 0 ){ int i = c & 0377; } }; streambuf::overflow( int c ){ sputc( c ); another_sputc( c ); } ---- outlined: int _streambuf_overflow (this , c ) struct streambuf *this ; int c ; { int sputc_streambuf ; int another_sputc_streambuf ; sputc_streambuf = 255 ; // here is the bug another_sputc_streambuf = (c & 0377 ) ; } ---- A negatif default value overwrites argument to inline (-1 as well as -2 ..) There is this bug in the stream library. Can you reply me the solution? Sincerly Philippe -- Marc Shapiro INRIA Bat. 11 B.P. 105 78153 Le Chesnay Cedex France tel. +33 (1) 39-63-53-25 uucp: seismo!mcvax!inria!shapiro or: shapiro@inria.inria.fr