On 2016-01-11 20:49:53 -0700, [email protected] wrote: > Vincent Lefevre <[email protected]> wrote: > > > 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. > > Coding styles have changed over the years. I don't disagree with you, > but remember that there are millions of lines of C code out there, > written who knows how long ago. Compilers have to support such > code bases, which is why the C standard didn't disallow implicit > declarations.
Implicit declarations dated back from K&R C, where prototypes were not checked. Old code is not guaranteed to work with new compilers anyway and may have security issues (which wasn't a problem in the past). Rejecting implicit declarations would be safer in practice. For compiling old code (which is still rather rare compared to the usual use of compilers), a special option could be added, which the user could choose if he doesn't want to clean up the code. -- 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
