Skip to content

Coding - Moving to Sprintf call#675

Merged
dpasukhi merged 4 commits into
Open-Cascade-SAS:IRfrom
dpasukhi:Sprintf_update
Aug 17, 2025
Merged

Coding - Moving to Sprintf call#675
dpasukhi merged 4 commits into
Open-Cascade-SAS:IRfrom
dpasukhi:Sprintf_update

Conversation

@dpasukhi
Copy link
Copy Markdown
Member

Moving out from sprintf to OCCT's Sprintf call to avoid warnings about format-nonliteral.

@dpasukhi dpasukhi requested a review from Copilot August 16, 2025 11:40
@dpasukhi dpasukhi self-assigned this Aug 16, 2025
@dpasukhi dpasukhi added the 2. Enhancement New feature or request label Aug 16, 2025
@dpasukhi dpasukhi added this to the Release 8.0 milestone Aug 16, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request replaces the standard C sprintf function with OCCT's custom Sprintf function throughout the codebase to avoid compiler warnings about format-nonliteral. The change ensures consistent locale handling and improves code safety by using OCCT's centralized string formatting utility.

  • Updates function calls from sprintf to Sprintf across the entire codebase
  • Updates comments and documentation references to reflect the new function name
  • Adds format attribute annotations to the Sprintf function declaration for better compiler validation

Reviewed Changes

Copilot reviewed 130 out of 130 changed files in this pull request and generated 1 comment.

File Description
Standard/Standard_CString.hxx Adds format attribute annotations to Printf, Fprintf, Sprintf, and Vsprintf functions
Standard/Standard_CLocaleSentry.hxx Updates documentation comment from sprintf to Sprintf
Multiple .cxx files Replaces all sprintf calls with Sprintf calls throughout the codebase
Multiple .hxx files Updates comments from sprintf to Sprintf references

Comment thread src/FoundationClasses/TKernel/Standard/Standard_CString.hxx Outdated
Moving out from sprintf to OCCT's Sprintf call to avoid warnings about format-nonliteral.
dpasukhi and others added 2 commits August 17, 2025 09:54
Signed-off-by: Pasukhin Dmitry <dpasukhi@opencascade.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Pasukhin Dmitry <pasuhinsvzn@gmail.com>
@dpasukhi dpasukhi merged commit 5ae60b5 into Open-Cascade-SAS:IR Aug 17, 2025
23 checks passed
@dpasukhi dpasukhi deleted the Sprintf_update branch August 17, 2025 11:45
@github-project-automation github-project-automation Bot moved this from Todo to Done in Maintenance Aug 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. Enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

There is an alarm when compiling and building using the macos clang toolchain:

2 participants