-
Notifications
You must be signed in to change notification settings - Fork 18
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
Fix ISO c++ does not allow assigning string literals to char* #79
Fix ISO c++ does not allow assigning string literals to char* #79
Conversation
74f3d7e
to
8f4f33d
Compare
@peter-urban thank you for jumping on this. But why are about 500,000 changes showing up in gsw_saar_data.h? |
8f4f33d
to
3271692
Compare
Oops, that was accidental auto-formatting. Should be fixed now. |
Googling turned up a nice utility program: $ cdecl explain "const char **x" |
This comment was marked as outdated.
This comment was marked as outdated.
1bda1f0
to
f2cea8e
Compare
Reverted the changes I mentioned in the last comment. (multiple_declaration failures when including gsw_saar_data.h because gsw_get_version is neither declared static or inline.) |
However, I believe the function does exactly the same as it did before this PR, so it should be fine |
1123de0
to
b572173
Compare
b572173
to
6bab8d8
Compare
@peter-urban what does your latest force-push do? And do we need to keep all 3 commits, given that numbers 2 and 3 just cancel out? I could use the "squash and merge" option to simplify the history. |
to non-cost char pointers. Fix: use const char* instead
6bab8d8
to
75c2c6d
Compare
Sorry for the force push. I just rebased the branch to the latest main not realizing that this may cause confusion after approval. |
I squashed the commits; (I actually didn't know that this was possible until you just mentioned it) |
First partial fix for #77
This fixes the c++ warnings related to assigning constant strings to char*
The fix is simple and works in c and c++ :
Most of the changes are unproblematic, since they only happen in gsw_check_functions.c
However, there is one change in gsw_saar_data.h (line 6,7 and 9). I wouldn't mind someone with better C command to double check this: