From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31611 invoked by alias); 21 Feb 2007 16:26:41 -0000 Received: (qmail 31583 invoked by uid 48); 21 Feb 2007 16:26:29 -0000 Date: Wed, 21 Feb 2007 16:26:00 -0000 Subject: [Bug c/30916] New: Wrong ‘float’ rather than ‘double’ due to prototype warning X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "hermantenbrugge at home dot nl" 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: 2007-02/txt/msg02485.txt.bz2 The following code: void func (float a); void func (float a) { } int main (void) { func (3.0f); return 0; } Compiled with: gcc -Wconversion bug.c produces: bug.c: In function ‘main’: bug.c:10: warning: passing argument 1 of ‘func’ as ‘float’ rather than ‘double’ due to prototype I was not expecting this. When looking at the code in c-typeck.c at line 2473. I see: /* Warn if any argument is passed as `float', since without a prototype it would be `double'. */ if (formal_prec == TYPE_PRECISION (float_type_node) && type != dfloat32_type_node) Should the dfloat32_type_node be changed into float_type_node? When I change this no warning is produced anymore. -- Summary: Wrong ‘float’ rather than ‘double’ due to prototype warning Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: hermantenbrugge at home dot nl GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30916