Skip to content

Commit

Permalink
clang: -Wunsafe-buffer-usage (charlesnicholson#252)
Browse files Browse the repository at this point in the history
* clang: -Wunsafe-buffer-usage

* clang: -Wunsafe-buffer-usage

* clang: -Wunsafe-buffer-usage

* shut up apple-vs-linux clang warning stuff

* guard apple

* bump

* guard apple

* guard apple

* guard apple

* bump
  • Loading branch information
charlesnicholson authored Oct 22, 2023
1 parent ebc97eb commit deb1b59
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions nanoprintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ NPF_VISIBILITY int npf_vpprintf(
#pragma GCC diagnostic ignored "-Wc++98-compat-pedantic"
#pragma GCC diagnostic ignored "-Wcovered-switch-default"
#pragma GCC diagnostic ignored "-Wdeclaration-after-statement"
#ifndef __APPLE__
#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
#endif
#elif NANOPRINTF_GCC_PAST_4_6
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
Expand Down
1 change: 1 addition & 0 deletions tests/conformance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#pragma GCC diagnostic ignored "-Wold-style-cast"
#ifndef __APPLE__
#pragma GCC diagnostic ignored "-Wreserved-identifier"
#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
#endif
#endif
#pragma GCC diagnostic ignored "-Wformat"
Expand Down
4 changes: 4 additions & 0 deletions tests/doctest_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@
#pragma warning(disable:5264) // unused const variable
#endif

#if defined(__clang__) && !defined(__APPLE__)
#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
#endif

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include "doctest.h"
2 changes: 1 addition & 1 deletion tests/mpaland-conformance
Submodule mpaland-conformance updated 1 files
+1 −0 paland.cc
1 change: 1 addition & 0 deletions tests/unit_nanoprintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#pragma GCC diagnostic ignored "-Wc++98-compat-pedantic"
#ifndef __APPLE__
#pragma GCC diagnostic ignored "-Wreserved-identifier"
#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
#endif
#endif
#endif
Expand Down

0 comments on commit deb1b59

Please sign in to comment.