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

Suppress format-security warning #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ruddyscent
Copy link

The project rubric requests not to generate any warnings during the build process, so the starter code should not raise any warnings. However, it does raise the following warnings:

src/ncurses_display.cpp:33:12: warning: format not a string literal and no format arguments [-Wformat-security]
   33 |   mvwprintw(window, ++row, 2, ("OS: " + system.OperatingSystem()).c_str());
      |   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This PR uses the methods in this thread to suppress the above warnings.

The warning message is
```
src/ncurses_display.cpp:33:12: warning: format not a string literal and no format arguments [-Wformat-security]
   33 |   mvwprintw(window, ++row, 2, ("OS: " + system.OperatingSystem()).c_str());
      |   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
The solution is listed at [this thread](spdk/spdk#2237).
@ruddyscent ruddyscent requested a review from a team as a code owner September 10, 2023 14:03
@ruddyscent ruddyscent requested review from SudKul and removed request for a team September 10, 2023 14:03
Fix format of code
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