This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc/gcc/cp ChangeLog dump.c


Nathanael Nerode <neroden@twcny.rr.com> writes:

> Where can I find this discussion?  I've been following the lists
> closely since the time the conversion to ISO C was suggested.  I
> remember nothing to the effect that "All changes to a function to make
> it conform to ISO C must be delayed, until they can change all
> conceptually boolean return types to bool".

To correct a widespread error of fact -

It is perfectly okay to have functions that must be K+R compatible
return bool (alias char).  The return type declaration is visible to
both K+R and ISO compilers, and K+R compilers will do the Right Thing
with them.

What does not work is to have a K+R compatible function with a 
FORMAL PARAMETER of type bool.  A K+R compiler will miscompile the
call site in that situation, since it does not know the types of the
arguments.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]