O ld fatal symbol referencing errors no output

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ssert ('z' == s [2]); 21 22 strm.getline (s, 1); 23 24 // 27.6.1.3, p17, bullet 3: 25 // Characters are extracted and stored until (n - 1) characters 26 // are stored (in which case the function calls setstate(failbit)). 27 // p20: 28 // In any case, it then stores a null character (using charT()) into 29 // the next successive location of the array. 30 31 assert (strm.goodbit == strm.rdstate ()); 32 assert (1 == strm.gcount ()); 33 assert ('\0' == s [0]); 34 assert ('y' == s [1]); 35 assert ('z' == s [2]); 36 37 strm.clear (); 38 strm.getline (s, 2); 39 40 // 27.6.1.3, p17, bullet 1: 41 // Characters are extracted and stored until end-of-file occurs on 42 // the input sequence (in which case the function calls setstate(eofbit)) 43 // p20: 44 // In any case, it then stores a null character (using charT()) into 45 // the next successive location of the array. 46 47 assert ((strm.eofbit | strm.failbit) == strm.rdstate ()); 48 assert (0 == strm.gcount ()); 49 assert ('\0' == s [0]); 50 assert ('y' == s [1]); 51 assert ('z' == s [2]); 52 } aCC -c -D_RWSTDDEBUG -mt -D_RWSTD_USE_CONFIG -I/build/sebor/aCC-6.0-15S/include -I/build/sebor/dev/stdlib/include -I/build/sebor/dev/stdlib/../rwtest -I/build/sebor/dev/stdlib/../rwtest/include -I/build/sebor/dev/stdlib/tests/include -AA -g +d +DD64 +w +W392 +W655 +W684 +W818 +W819 +W849 +W2193 +W2236 +W2261 +W2340 +W2401 +W2487 t.cpp aCC t.o -o t -L/build/sebor/aCC-6.0-15S/rwtest -lrwtest15S -AA +nostl -Wl,+s -L/build/sebor/aCC-6.0-15S/lib -mt +DD64 -L/build/sebor/aCC-6.0-15S/lib -lstd15S -lm Assertion failed: 'z' == s [2], file t.cpp, line 20 ABORT instruction (core dumped) std::istream::getline(char*, size_type) doesn't store NUL on failure The program below aborts at runtime. According to lib.istream.unformatted, p20: "[getline...] stores a null character (using charT()) into the next successive location of the array." $ cat t.cpp && nice make t -r && ./t #include <cassert> #include <sstream> int main () { std::istringstream str...
View Full Document

This document was uploaded on 10/12/2012.

Ask a homework question - tutors are online