From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11870 invoked by alias); 22 May 2008 08:17:04 -0000 Received: (qmail 11861 invoked by uid 22791); 22 May 2008 08:17:03 -0000 X-Spam-Check-By: sourceware.org Received: from fg-out-1718.google.com (HELO fg-out-1718.google.com) (72.14.220.157) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 22 May 2008 08:16:41 +0000 Received: by fg-out-1718.google.com with SMTP id e21so2634729fga.28 for ; Thu, 22 May 2008 01:16:38 -0700 (PDT) Received: by 10.86.76.16 with SMTP id y16mr2789416fga.36.1211444198617; Thu, 22 May 2008 01:16:38 -0700 (PDT) Received: from Pep ( [90.12.82.158]) by mx.google.com with ESMTPS id l12sm3035507fgb.8.2008.05.22.01.16.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 22 May 2008 01:16:37 -0700 (PDT) From: =?iso-8859-1?Q?Laurent_Dufr=E9chou?= To: Subject: G++/GCC not detetcing stupid errors in code. Date: Thu, 22 May 2008 08:56:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Content-Language: fr x-cr-hashedpuzzle: 89w= AUJB BCDm BSab BkxE BlpR Cqyf FPAa FeCy FxOA GRdb GxG4 Hs3w H6Z+ JESP JIJx;1;ZwBjAGMALQBoAGUAbABwAEAAZwBjAGMALgBnAG4AdQAuAG8AcgBnAA==;Sosha1_v1;7;{753CFC1D-D721-4405-8EEA-A59404577AB9};bABhAHUAcgBlAG4AdAAuAGQAdQBmAHIAZQBjAGgAbwB1AEAAZwBtAGEAaQBsAC4AYwBvAG0A;Thu, 22 May 2008 08:16:22 GMT;RwArACsALwBHAEMAQwAgAG4AbwB0ACAAZABlAHQAZQB0AGMAaQBuAGcAIABzAHQAdQBwAGkAZAAgAGUAcgByAG8AcgBzACAAaQBuACAAYwBvAGQAZQAuAA== x-cr-puzzleid: {753CFC1D-D721-4405-8EEA-A59404577AB9} Message-ID: <48352be5.0c58560a.66c6.16bf@mx.google.com> Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-05/txt/msg00224.txt.bz2 Hi there, I=92m using g++ for the first time via gcc 4.1.2. I=92ve written a little code (first C++ oriented and because guys with whic= h I work come from C, it is slightly modified to compile with G++ and gcc) >>>>>>>>>>>>>>>>>>> Code >>>>>>>>>>>>>>>>>>>>>>>>>>>> =A0 //#include #include //using namespace std; int main() { =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 int toto; =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 short tata; =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 toto =3D 1111118; =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 tata =3D toto;=A0 //error 1! =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 //cout << toto << "tata:" << = tata << endl; =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 printf("%d %i",toto,tata); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 //return 0; //error 2 because= no return } >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> I i compile with gcc (cc), it detects no int returned error (OK good point) But the downcast (tata =3D toto) doesn=92t raise any warning! If I use G++ the downcast is not detected and even more the return is not also detected (!) I was thining that Gcc was really strict and I choose it because I was thinking that, I=92m quite disappointed :/ I=92ve tried =96Wall =96Wextra =96pedantic + a ton of other switch with no = luck=85 Do i miss something=A0?=20 How can I put Gcc in =93user is stupid I need to check all=94 mode? Laurent