-
Notifications
You must be signed in to change notification settings - Fork 452
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
Aliased enums behaving oddly #36
Comments
Hi @SoylentGraham, thanks for issues. |
Back on osx today, so will see if I have the same problems, but pretty sure I don't (probably why I only just started seeing it go wrong) I'll also find time to do a minimal repro |
Also note: I'm using the latest (I was a bit behind, but updating to master made no difference) |
Seems to be fine in xcode ( |
@SoylentGraham It looks like the behavior of aliases has broken on vs17, but is correct on vs19. I’m still investigating this problem, but it seems necessary to add to the documentation that the order with aliases is undefined. |
Is the undefined order causing the empty strings? or is that a side effect? (In my case, I don't mind which comes up, but null strings are a problem) |
Unfortunately, yes, adding aliases occur empty strings, because the compiler cannot output either the actual value or the alias. I can offer such a workaround
|
I thought this wasn't a bug in 2019?
Is it still broken in 2017?
On Sun, 31 May 2020 at 1:14 pm, Daniil Goncharov ***@***.***> wrote:
Closed #36 <#36>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#36 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQVIBLGNOQDTV37TGELK4LRUJC3FANCNFSM4MY6KFJQ>
.
--
- Graham Reeves
- http://www.grahamreeves.com/
|
@SoylentGraham In 2019, it works correctly. In 2017, unfortunately, with aliasing of enums, its has broken. |
From the limitations, I see that aliases don't work, this would be fine, but I seem to be getting an odd case where the first-use of a value, is NOT the one used, furthermore, I'm getting
0x0
for a string, instead of the alias. (Either in my case would be fine, but not an empty string)THEN, debugging in vs17, when I look at the
strings
table (which I guess is all the names baked into an array) my values START at 128 instead of 0this is the enum https://github.com/SoylentGraham/SoyLib/blob/master/src/SoyPixels.h#L22
I've been using this library for a while now without problems, even with this enum, so perhaps I've just missed this case, or in this particular code I'm using it in a strange way... (still investigating :)
The text was updated successfully, but these errors were encountered: