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

This is not how C works #12

Open
mateoconlechuga opened this issue Sep 6, 2021 · 2 comments
Open

This is not how C works #12

mateoconlechuga opened this issue Sep 6, 2021 · 2 comments

Comments

@mateoconlechuga
Copy link

By having variables and code in a header file, every time that header is included in a different file, a separate function and variable is created. No one should touch this library as is unless they want to stare at endless linker issues and broken code.

@crowja
Copy link

crowja commented Sep 6, 2021

In its place, tinytest.h has been very helpful for me.

@mateoconlechuga
Copy link
Author

Ok? That is irrelevant. I'm not saying that it isn't useful, I'm saying that the source code is horrendous. You cannot take a .c file, give it a .h extension, and call it a "single header library" -- not only does this violate the very premise of how C works, it leads to issues that people may not be aware of. Declaring functions and variables in a header file does not protect against multiple compiler invocations, and header guards do not prevent this either.

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

No branches or pull requests

2 participants