From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23303 invoked by alias); 14 Jul 2009 19:21:20 -0000 Received: (qmail 23247 invoked by uid 48); 14 Jul 2009 19:21:09 -0000 Date: Tue, 14 Jul 2009 19:21:00 -0000 Message-ID: <20090714192109.23246.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/40752] -Wconversion generates false warnings In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia at gcc dot gnu dot org" 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: 2009-07/txt/msg01151.txt.bz2 ------- Comment #1 from pinskia at gcc dot gnu dot org 2009-07-14 19:21 ------- Theses are not false warnings: c >>= 1; is really c = (int)c >> 1; c += (char) 1; c = (int)c + (int)(char)1; c += c2; c = (int)c + (int) c2; c = ~c2; c = ~(int)c2; Only the last one might be a false warning depending on if c2 is negative or unsigned or not. The rest are correct because of the way C/C++ define arithmetic operations and automatic promotions. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40752