From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32077 invoked by alias); 3 Nov 2012 11:11:31 -0000 Received: (qmail 32004 invoked by uid 48); 3 Nov 2012 11:11:16 -0000 From: "meanarbez at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55189] g++ compiler does not report missing return on function with return type Date: Sat, 03 Nov 2012 11:11: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: meanarbez 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-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-11/txt/msg00205.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55189 --- Comment #2 from meanone 2012-11-03 11:11:15 UTC --- (In reply to comment #1) > (In reply to comment #0) > > Compiled with MinGW port of g++, compiles without errors or warnings: > > It does warn if you ask it to: -Wall I can understand that this is ok behavior for C, but to have to EXPLICITLY ASK typesafe language like C++ to inform me if function WITH RETURN TYPE does not return anything ? If this is not bug why shouldn't we make int n; n =; printf("%d",n); to be legal code, compiler should simply assign whatever it wants. Right ? Could anyone explain what for should missing return on typical C++ function be useful at all ? Not to mention probability that it has been forgotten by mistake. -Wreturn-type should be set by default.