Subject: Re: [SG10] Adding a macro to identify the ABI
From: Ed Smith-Rowland (3dw4rd_at_[hidden])
Date: 2017-01-07 14:32:17
On 01/06/2017 08:45 PM, Saleem Abdulrasool wrote:
> I was wondering if it would be possible to add a macro to identify the
> underlying ABI that the C++ runtime is using? Although itanium is the
> more popular choice, there are alternative ABIs such as the one which
> Microsoft uses. I would propose something like the following:
> They would be defined to 1 based on which is being used. This would
> allow the implementation to change the behavior based on the ABI being
> Saleem Abdulrasool
> compnerd (at) compnerd (dot) org
> Features mailing list
This is an interesting idea. ABI is not really a language problem so
the idea might not catch here. ^H...^H. Actually, every time a language
feature is added the ABIs have to add it.
On the other hand portability ideas have been floated before and were
found illuminating (There was a paper about standardizing an ABI and..
Hinnant? Can't remember.)
One thing that pops into my mind is that even within one ABI we have to
change it periodically. I'm thinking mostly library here. But even
language ABI you might want to date rather than just 1 or 0. The
library ABI would depend on library vendor more than chip vendor.
Jason Merrill knows a lot about this I think.
I know both language and library ABI would change with compiler switches.
In libstdc++ we can switch between a CoW string/list O(n)-size to a
C++11 string/O(1) list size world.
I'm interested in this.
SG10 list run by herb.sutter at gmail.com