[Top][All Lists]

[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: Edmund Grimley Evans
Subject: Re: [Tinycc-devel] Nevermind my previous comments. I just made an error.
Date: Tue, 12 Jan 2016 10:38:18 +0000


> Implicit declarations dated back from K&R C, where prototypes were
> not checked. Old code is not guaranteed to work with new compilers
> anyway

With a few specific exceptions, old code will work with a new
compiler, provided that the old code was correct. The problem, of
course, is that in the real world almost no C code is correct; most of
it just gets adjusted until it seems to work with a particular

For example, the ANSI spec says: "If the function is defined with a
type that does not include a prototype, and the types of the arguments
after promotion are not compatible with those of the parameters after
promotion, the behavior is undefined." Seeing as the old compiler was
unable to check that condition (it involves comparing types between
translation units), what are the chances of the programmer having got
it right in all cases?

reply via email to

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