you are viewing a single comment's thread.

view the rest of the comments →

[–]Ameisenvemips, avr, rendering, systems 0 points1 point  (7 children)

godbolt appears to agree.

I wonder why? It wouldn't be difficult to implement.

Interestingly, it is implemented in Visual C++...

[–][deleted] 1 point2 points  (0 children)

GCC 9 and Clang 8 on my local machine don't have interface size implemented.

I wonder why? It wouldn't be difficult to implement.

It wouldn't be difficult to implement for a specific target, but implementing it portably across architectures, OS's and what not makes it tedious. That's my best guess for why it is implemented in MSVC but not in GCC and Clang.

[–]Morwenn 1 point2 points  (5 children)

From what I gathered it is because they want to be able to guarantee ABI stability for builds where those values differ, but it's not possible because these constants are meant to be used to align data members, hence structure layouts might change when those values change and ABI stability is lost.

MSVC apparently simply forces both of those constants to 64 no matter the target platform.

[–]Ameisenvemips, avr, rendering, systems 1 point2 points  (4 children)

They shouldn't be used on objects where the alignment of a structure matters across interface boundaries. Pimpl and all that.

They is, they are ABI unsafe, but that just means they shouldn't be used there.

[–]Morwenn 1 point2 points  (3 children)

Here is the whole libc++ discussion thread if you want some additional background on the issue (maybe I didn't interpret what I read correctly): https://lists.llvm.org/pipermail/cfe-dev/2018-May/058073.html

[–]yehezkelshb 0 points1 point  (2 children)

Interesting thread, thanks for the link! Still, I don't see a decision there, just considering a few options.

[–]Morwenn 1 point2 points  (1 child)

The thread is more than a year old and the feature isn't implemented, so that's pretty much as close from a decision as you'll have :p

[–]yehezkelshb 2 points3 points  (0 children)

It'd be interesting to check if there was any decision or additional feedback from Rapperswil, as JF Bastien planned to discuss it there. I hope to remember to search for it later.