-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Make static context const #1639
Make static context const #1639
Conversation
Looks good to me. The only caveat is that this is, strictly speaking, a breaking change. If we want to be strict, we'd need a 0.7.0 instead of a 0.6.1. But I don't think we care?! I mean, any user code writing to the variable is most likely buggy... Hm. |
Technically speaking, this is certainly an API change. A constant and non-constant variable are not compatible as far as the C language is concerned. A (buggy) program could fail to compile with this change, while it was fine before. But is it an ABI break? The symbol still exists, and has the same size and meaning. Linking will not fail for any reason, it is only at runtime that an attempt to modify the variable may (or may not) trigger a memory violation. |
The good thing is that a clean crash is probably the worst that can happen in practice... I think I'm okay with anything here. If you ask me, we can treat this as a breaking or a non-breaking chance, when it comes to both API and ABI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In any case, I prefer this proper fix over introducing a second symbol just to keep backwards compatibility.
utACK bfc3ae0
We can debate at release time whether this is breaking or not.
cc @jonasnick @sipa Can you take a look? I think this will be good to have merged because it's addressing a real user issue. |
ACK |
bfc3ae0
to
432ac57
Compare
I just rebased and signed the commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 432ac57
Fixes #1637