Skip to content

audit C ABI compatibility for extern enums #977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
andrewrk opened this issue May 3, 2018 · 2 comments
Open

audit C ABI compatibility for extern enums #977

andrewrk opened this issue May 3, 2018 · 2 comments
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase.
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented May 3, 2018

  • do some C environments let you specify the tag type?
  • do some C environments make enums be c_long if you use a long const value or c_longlong if you use a long long const value?
  • should specifying tag type of extern enums be a compile error?

What it looks like to solve this issue is investigate these questions for all our target C environments:

  • gnu
  • msvc
  • cygwin
  • mysys? (windows + gnu)
@andrewrk andrewrk added the enhancement Solving this issue will likely involve adding new logic or components to the codebase. label May 3, 2018
@andrewrk andrewrk added this to the 0.4.0 milestone May 3, 2018
andrewrk pushed a commit that referenced this issue May 4, 2018
Fixed extern enums having the wrong size

See #977
@isaachier
Copy link
Contributor

isaachier commented May 9, 2018

This reminds me of a funny comment I came across recently:

// C++ is really really really really really really dumb about enums, so screw that and just make them anonymous
// This has the advantage of being ABI-able should we ever need an ABI...

https://github.com/andlabs/libui/blob/master/ui.h#L32-L34

@isaachier
Copy link
Contributor

Relevant issue in Vulkan docs: KhronosGroup/Vulkan-Docs#124.

@andrewrk andrewrk modified the milestones: 0.4.0, 0.5.0 Mar 20, 2019
@andrewrk andrewrk modified the milestones: 0.5.0, 0.6.0 Sep 20, 2019
@andrewrk andrewrk modified the milestones: 0.6.0, 0.7.0 Dec 9, 2019
@andrewrk andrewrk modified the milestones: 0.7.0, 0.8.0 Oct 10, 2020
@andrewrk andrewrk modified the milestones: 0.8.0, 0.9.0 Nov 6, 2020
@andrewrk andrewrk modified the milestones: 0.9.0, 0.10.0 May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase.
Projects
None yet
Development

No branches or pull requests

2 participants