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

Remove anonymous unions #218

Closed
wants to merge 5 commits into from
Closed

Remove anonymous unions #218

wants to merge 5 commits into from

Conversation

E5ten
Copy link
Contributor

@E5ten E5ten commented May 29, 2020

These are either GNU extensions to c99/c11, the toybox design page says it's supposed to be c99, so name previously anonymous unions "u".

@landley
Copy link
Owner

landley commented May 30, 2020

Read the comment at https://github.com/landley/toybox/blob/114541b98/toys/pending/sh.c#L1134 to see "yes, I am aware of this, I made an explicit choice to do it this way" because otherwise every reference to this gets gratuitously longer for no reason. It bloats the code for no benefit.

Portability TO WHAT? FOR WHO? What specifically are you trying to accomplish here? This builds with gcc and with llvm and presumably with intel's icc and I used to maintain a tinycc fork that I can pick up again and make compile this. The required behavior is not ambiguous.

@landley landley closed this May 30, 2020
@landley
Copy link
Owner

landley commented May 30, 2020

The design.html page mentions c99 three times. The first says "we depend on c99 and posix-2008 features" but then immediately talks about how we depend on stuff that isn't in either. (I.E. we're using those as a baseline. Necessary but not sufficient.) The second mention of c99 says "c99 allows this but don't do it". The third mention just says we use // style comments more than /* */ because you never have to worry about terminating a //, the issue of "nesting" doesn't come up ether, and I have yet to personally encounter an asterisk-at-start-of-line alignment war over multiline //.

It does not say we never use anything that ISN'T in a standard.

@E5ten
Copy link
Contributor Author

E5ten commented May 30, 2020

Sorry, I took the paragraph talking about c99 (the one following "I don't do windows.") to mean that library types/functions/headers, and things related to the environment it's used in (like /proc) that aren't part of c99 were also required, I didn't realize that actual language extensions on-top of c99/posix were also included in the kind of extra stuff that was required.

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.

None yet

2 participants