OpenCL-CTS icon indicating copy to clipboard operation
OpenCL-CTS copied to clipboard

CI macos image deprecates sprintf

Open svenvh opened this issue 2 years ago • 3 comments

The macos-latest GitHub Actions image switched to Xcode 14.2 recently, which deprecates sprintf (and possibly other functions?). This breaks -Werror builds, which includes the pre-commit builds running on each PR. The use of sprintf is quite widespread (over 400 occurrences).

For the short term, should we disable -Wdeprecated-declarations for macos builds, to unblock the automated checks?

For the longer term, should we migrate all sprintf calls to alternatives like snprintf?

svenvh avatar Jan 24 '23 16:01 svenvh

for the reference, error message says:

test_read_1D.cpp:1082:5: error: '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.

shajder avatar Jan 24 '23 16:01 shajder

I will look at this - adding -Wdeprecated-declarations if possible just for macos. I might venture into the 400 changes if I have a rainy Sunday

MeyeChris avatar Jan 24 '23 16:01 MeyeChris

I might venture into the 400 changes if I have a rainy Sunday

@MeyeChris if you decide to do so, I'd suggest doing them in batches as it will make reviews a bit more manageable (plus you don't have to wait for a day with bad weather ;)). But perhaps we should first reach consensus from others on whether we want to do this; sprintf isn't deprecated by POSIX yet afaict.

svenvh avatar Jan 27 '23 13:01 svenvh