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

OpenBSD Improvements #5558

Closed

Conversation

chris-huxtable
Copy link
Contributor

  • Improves readability of arguments
  • Improves similarity to referenced c headers
  • Expands several sets of constants, functions, and function like macros

Reorders and comments constants to be more consistant with the contents of unistd.h
“The explicit_bzero() variant behaves the same [as bzero()], but will not be removed by a compiler's dead store optimization pass, making it useful for clearing sensitive memory such as a password.”
Based of pthread.h and pthread_np.h
Based on netdb.h
@ysbaddaden
Copy link
Contributor

ysbaddaden commented Jan 9, 2018

I'm sorry you took so much time to update C bindings for OpenBSD. They were automatically generated, and OpenBSD C headers don't set names for function arguments, hence the placeholder. Hence absense of comments, ...

We aim to eventually generate bindings on-the-fly, so any manual work in C bindings is superfluous, since bindings will be overwritten sooner or later with other automatically generated ones.

@jhass
Copy link
Member

jhass commented Jan 9, 2018

Maybe we should add some comment at the top of these files that they're generated and manual changes might get overwritten? Ideally the generator would add such.

@RX14
Copy link
Contributor

RX14 commented Jan 9, 2018

It's my opinion that saying "these C bindings are automatically generated" doesn't make any sense when we don't even have up-to-date manifests equivalent to all the manual definitions that have accumulated since these were automatically bootstrapped. We can't (without work) generate the equivalent set of C bindings in the stdlib today, so how can we say they're automatically generated? To me it's a double standard (we accept some manual edits but not others) which must be rectified by re-generating the bindings from scratch and not accepting any more edits which aren't generated by the generator.

@chris-huxtable
Copy link
Contributor Author

  • The man pages contain function arg names.
  • If they are automatically generated there are a few type related errors that got through.

Why would we discard manually built documents if they were superior to ones auto-generated? That artificially keeps the base only as good as it can be auto-generated which has pretty big limitations without arg names and type errors.

The end goal may be to auto-generate bindings on-the-fly but useful information is missed or doesn't make its way through. Shouldn't these files be as human friendly as possible?

Wouldn't a better and easier solution be a checker then a generator? Something that picks up on differences between the crystal and c headers and flags discrepancies rather then writing over everything wholesale? This would allow the best of both worlds.

@asterite
Copy link
Member

asterite commented Jan 9, 2018

@chris-huxtable I believe all the docs about this is in man pages already, or in openbsd somewhere. The bindings are just bindings to existing things which already exist and are documented, they aren't something new that needs a documentation to be understood. Plus most of it was generated automatically and never used by crystal users, only in some parts of the standard library, so it's internal. It doesn't matter if it's not sorted or undocumented because you can either way find references to them here, the internet, etc.

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

5 participants