On 2016-01-11 05:44:11 +0200, Aharon Robbins wrote:
> C++ does reject the call. C is much more permissive. Try
> 
> $ cat > hello.c
> int main() { printf("hello, world\n"); return 0; }
> ^D

With the -pedantic-errors option (whose goal is to reject non-ISO
programs), gcc rejects the code. This seems to be a change in C99,
because the code is not rejected with -ansi -pedantic-errors.

By default, gcc doesn't reject the code, but emits a warning, which
is better than nothing. Well, tcc emits a warning too.

IMHO, nowadays, it would be better for the user if compilers reject
implicit declaration of functions by default, since warnings can
easily remain unnoticed since an implicit declaration is an obvious
bug or at least very poor & non-standard coding.

-- 
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