This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Multiple ABIs for a single compilation unit?
> Even the current __attribute__s for function call conventions are a bit
> lacking. To my knowledge, there are no attributes for
> -freg-struct-return, -fname-mangling-version-x, etc. Having all of these
> definable on a per-block basis would, I think, help in migrating to
> newer name mangling versions etc..
>
> So is there any idea in this? I might even be able to help in
> implementing it, although currently (having occasionally glanced at the
> source), I have no clue of the compiler's internals...
If there are no attributes now for that, it is an indication that the
compiler isn't capable of remembering that on a per-declaration basis,
but that these flags are truly global.
So you would need first to identify what features you want to select
on a per-declaration basis, and then modifiy the compiler to support
that. In some cases, it might not be trivial: If you use
-fname-mangling-version on a block, and in the block is a function
with a parameter type for which explicitly a different mangling
version was requested - which one should you use?
Regards,
Martin