On 2016-01-10 06:15:38 -0700, [email protected] 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 <[email protected]> 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 <[email protected]> - 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)

_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to