dpc10ster / RJafroc

Artificial Intelligence: Evaluating AI, optimizing AI
19 stars 8 forks source link

warning: 'sprintf' is deprecated #87

Closed dpc10ster closed 1 year ago

dpc10ster commented 1 year ago

The issue

Xcode is generating a "significant" warning after recent MacOS upgrade to 12.6.1 (21G217) when I build Cpp code in this package. See commit message in 5cdb9f34c7fb893fc9f1831a5abc2421701541d5. The warning is (you need to scroll horizontally to see the whole message):

Found the following significant warnings:
  /Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include/Rcpp/internal/r_coerce.h:255:7: 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. [-Wdeprecated-declarations]
See ‘/Users/Dev/GitHub/RJafroc.Rcheck/00install.out’ for details.

I do not use sprintf in my code; it appears to be called in a header file(s) that I have to include to compile my code. This warning does not occur in an iMac running an older version of OSX (Catalina) and Xcode.

It occurs only on Mac OS 12.6.1 which comes with Xcode 14.1.

Steps to fix

Delete Xcode 14.1 in Applications folder Restore older version (July 11, 2022) from TimeMachine (my fix assumes you are using TimeMachine). Restored Version is: 13.4.1 (13F100)

00check.log