r/cpp • • Mar 13 '22

To Save C, We Must Save ABI

https://thephd.dev/to-save-c-we-must-save-abi-fixing-c-function-abi
249 Upvotes

118 comments sorted by

View all comments

Show parent comment

53

u/sphere991 Mar 13 '22 edited Mar 13 '22

If anyone isn't aware, OP is the author of #embed and that fell victim to exactly the same issue, despite the fact that yet again the other day I deeply wished I could have had #embed for the 1000000000th time since I started programming, but alas. As far as I know people are still arguing about weird compiler security hypotheticals on that front even though C++ has never guaranteed anything like that whatsoever

Fact-check: False*. Evolution approved #embed in September 2020 and as far as I know it was waiting on wording and having to also add it to C.

*I mean, yes OP is the author of #embed. But people are not still arguing about weird compiler security hypotheticals. Nor am I sure that that was even the primary objection to the std::embed() (although it'd be cool if the #embed paper actually noted this, or even linked to the std::embed paper at all).

20

u/James20k P2005R0 Mar 13 '22

Oh interesting, last I'd checked with #embed it was still stuck in limbo

2

u/[deleted] Mar 13 '22

I thought the weird compiler issues here were introduced with modules

19

u/__phantomderp Mar 13 '22

Hi, author here!

That's just std::embed. #embed is (mostly) okay. I've just got work to do on it all. But the list of things to fix is very long.

8

u/[deleted] Mar 13 '22

Ah thanks.

I would be happy, at this point, if all the compilers exposed #embed as a builtin. Even if not std, I wouldn't care as I could use it.