[Bug c/17573] redefinition of builtin generates error when K&R fn def used

jsm at polyomino dot org dot uk gcc-bugzilla@gcc.gnu.org
Mon Sep 20 23:11:00 GMT 2004


------- Additional Comments From jsm at polyomino dot org dot uk  2004-09-20 23:11 -------
Subject: Re:  New: redefinition of builtin generates error when
 K&R fn def used

On Mon, 20 Sep 2004, bowdidge at apple dot com wrote:

> The following code generates an error if a function is defined in K&R 
> style, but not if the function is defined in ANSI C style:
> 
> extern float dremf ( float, float );
> 
> float
> dremf(x, y)
>         float x;
>         float y;
> {
>   return 1.0;
> }

This seems the same as bug 16666.  The code is invalid (prototypes for a 
function with an old-style definition must contain the argument types 
after default promotions), but is a documented GNU extension.



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17573



More information about the Gcc-bugs mailing list