This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: GCC problem/bug with floats


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]