Archived issue #0033472
Foundation Classes - NCollection_UBTreeFiller compiler warning -Wdeprecated-declarations
Description
During compilation of a project using OpenCascade v7.7.2 I get an annoying compiler warning regarding a deprecated use of `sprintf(3)` in the OpenCascade source:
System: macOS M1 arm64
Compiler: llvm clang 16 (homebrew version)
OpenCascade: 7.7.2 (homebrew version)
/opt/homebrew/include/opencascade/NCollection_UBTreeFiller.hxx:188:3: 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]
sprintf (buf, "Checking UBTree:%8d leaves, balance =%7.2f",
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("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.")
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
Does anyone else see this warning on other OCC versions, other compilers or other systems? I have searched the OpenCascade issue tracker but haven’t found anything regarding NCollection_UBTreeFiller. Otherwise I would open an issue in the OCC tracker and hope for a downstream fix.
System: macOS M1 arm64
Compiler: llvm clang 16 (homebrew version)
OpenCascade: 7.7.2 (homebrew version)
Public activity
2 archived notes
Participants are labeled by their role within this record.
Hey, I just reported this issue. I am not a dev knowledgable in the OCC source code. Please sign someone else from the OCC team to this issue.
Commenter 2 I will fix it. Thank you for your investigation.