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 cxmon -Wformat-security error when building with gcc 10.2.0 #237

Merged
merged 1 commit into from
Mar 6, 2021
Merged

Fix cxmon -Wformat-security error when building with gcc 10.2.0 #237

merged 1 commit into from
Mar 6, 2021

Conversation

lukateras
Copy link
Contributor

@lukateras lukateras commented Mar 6, 2021

This patch replaces a call to fprintf() with a non-format prompt argument with corresponding fputs. This resolves a compilation error with the latest GCC version. Also see this FAQ.

./../../../cxmon/src/mon.cpp: In function 'void read_line(char*)':
./../../../cxmon/src/mon.cpp:285:24: error: format not a string literal and no format arguments [https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat-security>
  285 |  fprintf(monout, prompt);
      |                        ^

Let me know if you prefer this patch or fprintf(monout, "%s", prompt);.

@asvitkine asvitkine merged commit 4671258 into cebix:master Mar 6, 2021
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.

None yet

2 participants