This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: GCC problem/bug with floats
- To: "James Allwright" <jallwright at dcehost dot dcecomms dot com>, <gcc-bugs at gcc dot gnu dot org>
- Subject: Re: GCC problem/bug with floats
- From: "Tim Prince" <tprince at computer dot org>
- Date: Tue, 5 Sep 2000 04:41:16 -0700
- Cc: <J dot R dot Allwright at westminster dot ac dot uk>
- References: <20000905121512.A2290@dcehost.dcecomms.com>
In the absence of a prototype, a pre-ANSI function declaration requires
float arguments to be promoted to double, so it is as if a prototype had
declared a double argument.
----- Original Message -----
From: "James Allwright" <jallwright@dcehost.dcecomms.com>
To: <gcc-bugs@gcc.gnu.org>
Cc: <J.R.Allwright@westminster.ac.uk>
Sent: Tuesday, September 05, 2000 4:15 AM
Subject: GCC problem/bug with floats
>
> I believe that I have found a bug in the GCC compiler.
> I am running gcc version 2.8.1 in its DJGPP incarnation, but this is a
> problem that was originally spotted by someone running GCC on Linux.
> The following code appears to be legal C, but exhibits the problem :
>
> extern void vskip();
>
> void vskip(float gap)
> {
> /* do nothing */
> }
>
>
> Compiling this code with gcc -c gives :
>
> gccbug.c:4: conflicting types for `vskip'
> gccbug.c:4: An argument type that has a default promotion
> gccbug.c:4: can't match an empty parameter name list declaration.
> gccbug.c:1: previous declaration of `vskip'
>
> A workaround is to change the float to double.
>
> Regards,
>
> James Allwright