From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8396 invoked by alias); 24 Feb 2006 16:31:28 -0000 Received: (qmail 8380 invoked by uid 48); 24 Feb 2006 16:31:23 -0000 Date: Fri, 24 Feb 2006 16:53:00 -0000 Subject: [Bug c++/26458] New: Passing a NULL char* into output stream now breaks the output stream X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "phil at mitre dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-02/txt/msg02818.txt.bz2 List-Id: Prior behavior handled passing a char* with a NULL value into an output stream; the result was that nothing printed. As of versions 3 and later this behavior has changed. Perhaps a bug, perhaps a new enforcement. The result is that the output stream no longer writes anything (to file or stdout) until the descriptor is closed, and then only the unflushed text up until the NULL was passed. Example code: #include main() { char *str = NULL; cout << "Hello " << str << " there" << endl; cout << "still dead?" << endl; } Resulting output is: Hello_ No further output is sent. Perhaps, if it is deemed improper to allow a NULL in a known type being passed to a stream, then a SEG fault might be better than continue with no indication, except for lack of output. -- Summary: Passing a NULL char* into output stream now breaks the output stream Product: gcc Version: 3.2.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: phil at mitre dot org GCC build triplet: 2.3.2 20030502 (RedHat linux 2.3.2-53) GCC host triplet: RedHat linux 2.4.21-37 enterprise http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26458