From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24430 invoked by alias); 6 Nov 2006 16:30:28 -0000 Received: (qmail 24408 invoked by uid 48); 6 Nov 2006 16:30:16 -0000 Date: Mon, 06 Nov 2006 16:30:00 -0000 Message-ID: <20061106163016.24407.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/29739] -Wconversion produces invalid warnings. In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "lopezibanez at gmail dot com" 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-11/txt/msg00466.txt.bz2 List-Id: ------- Comment #2 from lopezibanez at gmail dot com 2006-11-06 16:30 ------- (a bit more explanation won't hurt) The GCC documentation says: -Wconversion: Warn if a prototype causes a type conversion that is different from what would happen to the same argument in the absence of a prototype. In your program, in the absence of prototype, d would be promoted to int, thus the warning is correct. Wconversion is only useful for translating very old C code to ANSI/ISO C. Since this behaviour is not very useful in the present day, and Wconversion also warns for unsigned i = -1, we are going to move the above behaviour to Wtraditional-conversion and make Wconversion warn for implicit conversions that may change a value. This is planned for GCC 4.3 . For more info, please check http://gcc.gnu.org/wiki/Wcoercion and don't hesitate to contact me. (That wiki page is work in progress, not definitive, actually, it is a bit outdated). Testing and comments are welcome. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29739