tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Nevermind my previous comments. I just made an error.


From: Vincent Lefevre
Subject: Re: [Tinycc-devel] Nevermind my previous comments. I just made an error.
Date: Mon, 11 Jan 2016 01:35:47 +0100
User-agent: Mutt/1.5.24-6551-vl-r83103 (2016-01-05)

On 2016-01-10 06:15:38 -0700, address@hidden wrote:
> 
> > On 2016-01-10 02:36:45 -0800, Ben Hutchinson wrote:
> > > I was working with the atan2 function, and it kept glitching all over the
> > > place. Turns out I forgot to include this line at the top of my code:
> > > #include <math.h>
> 
> Vincent Lefevre <address@hidden> wrote:
> > Is there any reason why tcc hasn't rejected the code because the
> > prototype wasn't declared?
> 
> Because C default declares functions for you. It's as if it was
> declared
> 
>       int atan2(...);

But I don't think that an implementation is disallowed to reject the
code. As I read the standard, the library functions are specified only
when the corresponding header is included. So, if the header is not
included, the implementation could complain that it doesn't know the
function.

Moreover, if the function types are not compatible like here, the
behavior is undefined. That's another reason...

-- 
Vincent Lefèvre <address@hidden> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]