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

Removed a use of sprintf that required changing a function signature #2743

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

seanm
Copy link
Contributor

@seanm seanm commented Sep 2, 2023

No description provided.

@seanm
Copy link
Contributor Author

seanm commented Sep 2, 2023

How does NetCDF deal with deprecating and replacing APIs? i.e. for this part:

-extern void cdRel2Iso(cdCalenType timetype, char* relunits, int separator, double reltime, char* chartime);
+extern void cdRel2IsoNew(cdCalenType timetype, char* relunits, int separator, double reltime, char* chartime, size_t chartime_size);
+extern void cdRel2Iso(cdCalenType timetype, char* relunits, int separator, double reltime, char* chartime); // deprecated

What shall we call the new API? cdRel2IsoNew is just a placeholder.

Do you have a deprecation macro that does similar to C23's [[deprecated]]? If not, I can add one.

Thanks.

@seanm seanm marked this pull request as draft September 2, 2023 01:13
@DennisHeimbigner
Copy link
Collaborator

I do not think this function change is a problem.
The change has no material affect on its operation.
The function is not part of the netcdf API (as defined in the
include/netcdfXXX.h files).

@seanm seanm changed the title WIP: Removed last use of sprintf, but it required changing a public API Removed a use of sprintf that required changing a function signature Sep 3, 2023
@seanm seanm marked this pull request as ready for review September 3, 2023 16:46
@seanm
Copy link
Contributor Author

seanm commented Sep 3, 2023

Ah, I thought it might have been public API. Patch updated.

@DennisHeimbigner
Copy link
Collaborator

There is one other point. If memory serves, the nctime code was taken from some other site.
It is possible that if this site is still being updated, that we should consider updating out code
to match. This might obviate the need for this change.

@seanm
Copy link
Contributor Author

seanm commented Sep 4, 2023

I've done some searching and tried to find an upstream, but most searches just bring me to netcdf.

@seanm
Copy link
Contributor Author

seanm commented Sep 8, 2023

@DennisHeimbigner I've just tried again, but can't find any upstream. Closest I got is: https://cdat.llnl.gov/

if that's it, they aren't maintaining it anymore anyway.

@seanm
Copy link
Contributor Author

seanm commented Nov 15, 2023

Rebased with latest main.

@WardF @DennisHeimbigner this one is ready to merge IMHO, pending your reviews.

@WardF WardF merged commit b99a263 into Unidata:main Dec 11, 2023
99 checks passed
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.

3 participants