sbmlteam / libsbml

LibSBML is a native library for reading, writing and manipulating files and data streams containing the Systems Biology Markup Language (SBML). It offers language bindings for C, C++, C#, Java, JavaScript, MATLAB, Perl, PHP, Python, R and Ruby.
https://sbml.org/software/libsbml
Other
39 stars 28 forks source link

add printf style formatting to Rf_error calls #375

Closed spotaws closed 4 months ago

spotaws commented 4 months ago

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

Checklist:

Testing