Skip to content
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

skip typeinfo for struct/enum in betterC mode #6922

Merged
merged 1 commit into from
Jun 21, 2017

Conversation

adamdruppe
Copy link
Contributor

Currently, if you try to compile a -betterC thing with a struct, it gives a linker error. This skips typeinfo letting them work in the simple case.

Whereas -betterC is a "rip stuff out" hack in the first place, this little change fits right in with it. And with this, I consider -betterC to actually live up to its name - the C subset of D is actually usable now, out of the box, given the switch.

@adamdruppe
Copy link
Contributor Author

BTW I'd also like to make it skip the opEquals generation, but I don't know where that is in the compiler and need to get back to work on my real job. Skipping that should enable slices inside structs to work too. And if someone actually does arr == arr2, then... well, maybe generate it but I don't mind just giving them the ugly linker error. You can't do that in C anyway, and if you really want to, just define an operator overload.

@WalterBright WalterBright merged commit 0999e94 into dlang:master Jun 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants