From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27629 invoked by alias); 25 Apr 2014 02:44:46 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 27580 invoked by uid 48); 25 Apr 2014 02:44:40 -0000 From: "sree.gooogle at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/60959] New:=?UTF-8?Q?=20Does=20=E2=80=9Ccout?=<<(char*)=?UTF-8?Q?NULL=E2=80=9D=20doing=20=E2=80=9Cclose?=(1)=?UTF-8?Q?=E2=80=9D=20?=? Date: Fri, 25 Apr 2014 02:44:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sree.gooogle at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-04/txt/msg01857.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D60959 Bug ID: 60959 Summary: Does =E2=80=9Ccout<<(char*)NULL=E2=80=9D doing =E2=80= =9Cclose(1)=E2=80=9D ? Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: sree.gooogle at gmail dot com In the following piece of C++ code I have used cout<<(char*)NULL; after this line, my program printing nothing to the output screen. Does it mean I have done close(1) with cout here? #include using namespace std; void f(){ cout<<"\nfun\n"; } main(){ cout<<(char*)NULL; f(); //not getting printed ! cout<<"\nhello\n"; //not getting printed ! cout<<"hii how are you?"; //not getting printed, why?? } compiled using: g++ myprog.cpp run: ./a.out o/p: Prints nothing I have tried this code in gcc as well as DevCpp compiler, same behavior observed. Is this a compiler bug? Please provide detailed information about this behavior.=20 Thank you! >>From gcc-bugs-return-449838-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Apr 25 02:51:27 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 31660 invoked by alias); 25 Apr 2014 02:51:27 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 31627 invoked by uid 48); 25 Apr 2014 02:51:22 -0000 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/60959]=?UTF-8?Q?=20Does=20=E2=80=9Ccout?=<<(char*)=?UTF-8?Q?NULL=E2=80=9D=20doing=20=E2=80=9Cclose?=(1)=?UTF-8?Q?=E2=80=9D=20?=? Date: Fri, 25 Apr 2014 02:51:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status resolution Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-04/txt/msg01858.txt.bz2 Content-length: 555 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60959 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Andrew Pinski --- No it sets the badbit on the stream which causes nothing to be printed after that. if (!__s) __out.setstate(ios_base::badbit);