This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: C++ name mangling in C
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: daniel at poradnik-webmastera dot com
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Mon, 11 Aug 2014 12:24:53 +0100
- Subject: Re: C++ name mangling in C
- Authentication-results: sourceware.org; auth=none
- References: <20140809215057 dot Horde dot vyEDuGF06pHW1H_WOtKpyw1 at sirzooro dot prohost dot pl> <CAH6eHdTwP-1p3OS8pZM6gs8fW1-5Ojob7hqBnyweqdzQCsRxiA at mail dot gmail dot com> <20140810215514 dot Horde dot 4cJmUEtNwCy1YcH5ioNT9g1 at sirzooro dot prohost dot pl> <CAH6eHdQxCZ0pJroHsOOt31tz-34MQPRkY9sRiGs_n+-N5AH_-Q at mail dot gmail dot com> <20140811124543 dot Horde dot pXSGtMzLIHVjX3-Xj3hoHA1 at sirzooro dot prohost dot pl>
On 11 August 2014 11:45, <daniel@poradnik-webmastera.com> wrote:
> I do not know GCC internals so I cannot estimate effort for such
> modification. I thought that this will not be so hard, but looks that is is
> not so easy.
"Make the C compiler have an option to act like the C++ compiler" is
basically an entire new language that is halfway between C and C++.
That's a huge amount of work and testing, which you're asking other
people to do because it is too difficult for you to fix your code.
> BTW, I realized that there may be an easier way to do such validation in GCC
> - write information about each function prototype (found where function is
> implemented) and each function call to object files (e.g. as debug data or
> in other format), and use it to perform validation in linker. What do you
> think about this?
That sounds more realistic (and would be useful to people using C, not
your suggested C-with-mangling) but I it's still many weeks of work by
many people, so you don't have to spend a month fixing your code. Even
if it happened, it wouldn't be available in released versions of GCC
and the linker for months, so it is not going to help you find "some
temporary solution to use now".