Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Hořeňovský2022-05-02 12:57:46 +0200
committerMartin Hořeňovský2022-05-03 13:54:05 +0200
commite2d07d35f4e31fa07fda89aadfb547e20b6b63b3 (patch)
tree680d1ddc28cc57dec6f5322d8c1d30a2d2bf5ffd
parentd2cb934d283bcaeb78ce9dec3f9755650db414ba (diff)
downloadcatch3-e2d07d35f4e31fa07fda89aadfb547e20b6b63b3.tar.gz
Add -Wmissing-prototypes to common warnings
-rw-r--r--CMake/CatchMiscFunctions.cmake1
-rw-r--r--tests/SelfTest/UsageTests/Compilation.tests.cpp6
2 files changed, 4 insertions, 3 deletions
diff --git a/CMake/CatchMiscFunctions.cmake b/CMake/CatchMiscFunctions.cmake
index 2271cf27..21f4f6c0 100644
--- a/CMake/CatchMiscFunctions.cmake
+++ b/CMake/CatchMiscFunctions.cmake
@@ -64,6 +64,7 @@ function(add_warnings_to_targets targets)
"-Wmissing-braces"
"-Wmissing-declarations"
"-Wmissing-noreturn"
+ "-Wmissing-prototypes"
"-Wmissing-variable-declarations"
"-Wnull-dereference"
"-Wold-style-cast"
diff --git a/tests/SelfTest/UsageTests/Compilation.tests.cpp b/tests/SelfTest/UsageTests/Compilation.tests.cpp
index d45f8e6c..5d9ab3f0 100644
--- a/tests/SelfTest/UsageTests/Compilation.tests.cpp
+++ b/tests/SelfTest/UsageTests/Compilation.tests.cpp
@@ -26,7 +26,7 @@ namespace bar {
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wmissing-declarations"
#endif
-std::ostream& operator<<(std::ostream& out, foo::helper_1403 const&) {
+static std::ostream& operator<<(std::ostream& out, foo::helper_1403 const&) {
return out << "[1403 helper]";
}
///////////////////////////////
@@ -49,7 +49,7 @@ struct logic_t {
};
-void throws_int(bool b) {
+static void throws_int(bool b) {
if (b) {
throw 1;
}
@@ -69,7 +69,7 @@ bool templated_tests(T t) {
struct A {};
-std::ostream &operator<<(std::ostream &o, const A &) { return o << 0; }
+static std::ostream &operator<<(std::ostream &o, const A &) { return o << 0; }
struct B : private A {
bool operator==(int) const { return true; }