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

Fix format-security warning in debug.c #130

Open
wants to merge 1 commit into
base: resynthesizer3
Choose a base branch
from

Conversation

Freso
Copy link

@Freso Freso commented Apr 10, 2024

g_printerr() and related take an fprint() style format string as first parameter, followed by arguments for that fprint() format string – just a string was supplied here. As this function was only supplying a string, compilers would raise a format-security warning, which is commonly raised as an error (-Werror=format-security), stopping the compilation.

Additionally, g_printerr() “should not be used from within libraries.” Instead, it is being replaced here by the g_message() convenience macro, which also takes care of inserting newlines if needed.

`g_printerr()` and related take an `fprint()` style format string as
first parameter, followed by arguments for that `fprint()` format string
– just a string was supplied here.

Additionally, `g_printerr()` “should not be used from within libraries.”
Instead it’s being replaced here by the `g_message()` convenience macro
which also takes care of inserting newlines if needed.
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.

1 participant