C++ Logo

sg10

Advanced search

Re: [SG10] Adding a macro to identify the ABI

From: Saleem Abdulrasool <compnerd_at_[hidden]>
Date: Sat, 7 Jan 2017 13:39:22 -0800
Thats an excellent point about the fact that the ABI does evolve over
time. You've convinced me on the use of the yyyymmdd instead of the
boolean for the values.

As to your point of how the language runtime/ABI library would be
influenced by this is exactly the motivation for this!

On Sat, Jan 7, 2017 at 12:32 PM, Ed Smith-Rowland <3dw4rd_at_[hidden]>
wrote:

> On 01/06/2017 08:45 PM, Saleem Abdulrasool wrote:
>
> Hi,
>
> 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:
>
> __cpp_abi_itanium
> __cpp_abi_microsoft
>
> 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 used.
>
> Thanks!
>
> --
> Saleem Abdulrasool
> compnerd (at) compnerd (dot) org
>
>
> _______________________________________________
> Features mailing listFeatures_at_[hidden]://www.open-std.org/mailman/listinfo/features
>
> 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.
>
> Ed
>
> __cpp_abi_itanium yyyymm
>
> ...
>
> __cpp_lib_abi_gnu yyyymm
>
> __cpp_lib_abi_msvc yyyymm
>
>
> 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.
>
> Ed
>
>
>
> _______________________________________________
> Features mailing list
> Features_at_[hidden]
> http://www.open-std.org/mailman/listinfo/features
>
>


-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org

Received on 2017-01-07 22:39:24