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

Update fmt to handle non-pointer struct/union/enum #1380

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@tgschultz
Contributor

tgschultz commented Aug 14, 2018

Since #1109 was merged we cannot be sure that a struct/union will be passed as a pointer. It might be better to implement this fix in the opposite direction: if it is a pointer, pass value.* back into formatType.

Update index.zig
Since #1109 was merged we cannot be sure that a struct/union will be passed as a pointer. It might be better to implement this fix in the opposite direction: if it is a pointer, pass `value.*` back into `formatType`.

@andrewrk andrewrk closed this in 820bf05 Aug 20, 2018

@andrewrk

This comment has been minimized.

Member

andrewrk commented Aug 20, 2018

I did have to do it the other way because the address of a by-value parameter is not meaningful. I also added basic support for printing structs via reflection. The case when structs have pointers to themselves is not
handled yet. Also enums/unions are not handled yet.

@tgschultz tgschultz deleted the tgschultz:patch-2 branch Oct 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment