Skip to content

skip typeinfo for struct/enum in betterC mode#6922

Merged
WalterBright merged 1 commit intodlang:masterfrom
adamdruppe:typeif_betterc
Jun 21, 2017
Merged

skip typeinfo for struct/enum in betterC mode#6922
WalterBright merged 1 commit intodlang:masterfrom
adamdruppe:typeif_betterc

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