Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add printf style formatting to Rf_error calls #375

Merged
merged 1 commit into from
May 24, 2024

Conversation

spotaws
Copy link

@spotaws spotaws commented May 19, 2024

Description

This change adds prinf style formatting to Rf_error calls. Without this, compilation fails when -Wformat-security is passed to gcc.

/home/spot/git/libsbml/libsbml-5.20.2/build/src/bindings/r/libsbml_wrap.cpp:330601:17: error: format not a string literal and no format arguments [-Werror=format-security]
330601 |         Rf_error(e.what());
       |         ~~~~~~~~^~~~~~~~~~

I have tested this in Fedora 41 (Rawhide) against gcc-14.0.1 and R 4.4.0 and it resolves the "Fails To Build From Source" issue.

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Change in documentation

Checklist:

  • I have updated all documentation necessary.
  • I have checked spelling in (new) comments.

Testing

  • Testing is done automatically and codecov shows test coverage
  • This cannot be tested automatically

…ity errors at compile time

Signed-off-by: Tom Callaway <spot@fedoraproject.org>
@fbergmann fbergmann self-requested a review May 24, 2024 13:09
Copy link
Member

@fbergmann fbergmann left a comment

Choose a reason for hiding this comment

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

thank you for this!

@fbergmann fbergmann merged commit e71dfd5 into sbmlteam:development May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants