thaler-lab / Wasserstein

Python/C++ library for computing Wasserstein distances efficiently.
https://thaler-lab.github.io/Wasserstein
Other
21 stars 8 forks source link

`sprintf` deprecation #14

Closed j-s-ashley closed 3 weeks ago

j-s-ashley commented 1 month ago

Debugging efforts are currently being slowed by a number of the following deprecation warnings: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.

Only occurs on MacOS builds.

matthewfeickert commented 1 month ago

I wouldn't spend too much time on this right now, as while warnings are useful things to fixup, this isn't fundamentally blocking for the time being.

matthewfeickert commented 1 month ago

Notice also how the signatures between sprintf and snprintf aren't the same:

so this isn't something that can get fixed with a simple

git grep --name-only "sprintf" | xargs sed -i 's/sprintf/snprintf/g'

as the signatures would need an additional argument.