This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Converting to ISO C89
Raja R Harinath <harinath at cs dot umn dot edu> writes:
> Hopefully the ISO C89 changes also make the source C++-safe.
It will not. There is extensive use of identifiers which are C++
keywords, such as 'class' and 'delete'. I do not think your
suggestion is useful enough to warrant changing all of these
identifiers.
What might be useful is an optional mode for the C compiler in which
function names get mangled as they would be in C++. That would have
the effect of type-checking procedure calls across translation units
at link time. To avoid mangling calls into libc it would have to be
switchable within each translation unit -- one plausible approach is
to recognize extern "C" and extern "C++" in C, another is #pragma.
(This extension would *not* provide function overloading in C; it
would affect only the DECL_ASSEMBLER_NAME of functions declared under
the special regime.)
zw