Skip to content

Fix deprecated vsprintf warning in SVM implementation#6312

Merged
mvieth merged 1 commit intoPointCloudLibrary:masterfrom
kai-waang:fix-vsprintf
Jul 27, 2025
Merged

Fix deprecated vsprintf warning in SVM implementation#6312
mvieth merged 1 commit intoPointCloudLibrary:masterfrom
kai-waang:fix-vsprintf

Conversation

@kai-waang
Copy link
Contributor

During compilation on macOS (15.5, on M4), the build process generated a deprecation warning for vsprintf in ml/src/svm.cpp.

open/pcl/ml/src/svm.cpp:127:3: warning: 'vsprintf' 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 vsnprintf(3) instead. [-Wdeprecated-declarations]
  127 |   vsprintf(buf, fmt, ap);
      |   ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:298:1: note: 'vsprintf' has been explicitly marked deprecated here
  298 | __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 vsnprintf(3) instead.")
      | ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
  218 |         #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
      |                                                       ^
1 warning generated.

The warning indicated that vsprintf is deprecated due to security concerns and recommended using vsnprintf instead, and this PR fixed it.

Copy link
Member

@mvieth mvieth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mvieth mvieth added changelog: enhancement Meta-information for changelog generation module: ml labels Jul 27, 2025
@mvieth mvieth merged commit b9c72df into PointCloudLibrary:master Jul 27, 2025
13 checks passed
@kai-waang kai-waang deleted the fix-vsprintf branch July 28, 2025 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: enhancement Meta-information for changelog generation module: ml

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants