-
Notifications
You must be signed in to change notification settings - Fork 595
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
NK_STRTOD has extra const qualifier that blocks using standard library #700
Comments
This should have been fixed in #682, but I forgot to rebuild nuklear.h at the time. It's been rebuilt since, so this issue should be resolved. |
I have seen some commits changing this back and forth so I worry that someone later might open an issue that the function has no The root cause of the problem is that the standard library function is missing If Nuklear does not form specific consistent approach it risks 1) inconsistency in API 2) back-and-forth issues to "fix" the code to the other way. |
I'm not sure why
"A pointer to the final string is stored in the object pointed to by endptr, provided that endptr is not a null pointer." - 1989 ANSI C standard 4.10.1.4 "The strtod Function" |
We could try to prevent problems like this by adding a rule to the Reviewers guide stating implementations of libc functions must have an equivalent signature. |
Bottom-level const is fine, that is, the function can theoretically have signature I would still follow standard library signature. It's better than trying to improve the API by breaking compatibility. |
Nuklear's code:
The problem - standard library is incompatible:
If I
#define NK_STRTOD strtod
then I'm getting the following error:Can you change the implementation so that it supports the standard library (without
const
)?The text was updated successfully, but these errors were encountered: