summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoronqtam <vik.kirilov@gmail.com>2018-04-30 22:54:19 +0300
committeronqtam <vik.kirilov@gmail.com>2018-05-10 16:18:43 +0300
commit41c08a543d57152ca339c2d25cc3272609a8edfc (patch)
treed147bb8f041e966049cf92c960dc2e1a8c12525f
parent3ae0631bad6aeb622ad2591a4eb559e79f862be0 (diff)
fixed issue #118 - silencing the problematic warning. the char buffer is already annotated to have the proper alignment - this is probably a misdiagnostic by the compiler and should be safe to silence
-rw-r--r--doctest/doctest.h6
-rw-r--r--doctest/parts/doctest_fwd.h4
2 files changed, 8 insertions, 2 deletions
diff --git a/doctest/doctest.h b/doctest/doctest.h
index febac6e..4102661 100644
--- a/doctest/doctest.h
+++ b/doctest/doctest.h
@@ -1472,7 +1472,7 @@ namespace detail
// forbidding some expressions based on this table: http://en.cppreference.com/w/cpp/language/operator_precedence
DOCTEST_FORBIT_EXPRESSION(&)
- DOCTEST_FORBIT_EXPRESSION (^)
+ DOCTEST_FORBIT_EXPRESSION(^)
DOCTEST_FORBIT_EXPRESSION(|)
DOCTEST_FORBIT_EXPRESSION(&&)
DOCTEST_FORBIT_EXPRESSION(||)
@@ -1882,6 +1882,7 @@ namespace detail
Node* tail;
void build(std::ostream* stream) const {
+ DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH("-Wcast-align")
int curr = 0;
// iterate over small buffer
while(curr < numCaptures && curr < DOCTEST_CONFIG_NUM_CAPTURES_ON_STACK)
@@ -1893,6 +1894,7 @@ namespace detail
curr_elem = curr_elem->next;
++curr;
}
+ DOCTEST_GCC_SUPPRESS_WARNING_POP
}
// steal the contents of the other - acting as a move constructor...
@@ -4368,6 +4370,7 @@ namespace detail
void addToContexts(IContextScope* ptr) { contextState->contexts.push_back(ptr); }
void popFromContexts() { contextState->contexts.pop_back(); }
DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(4996) // std::uncaught_exception is deprecated in C++17
+ DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH("-Wdeprecated-declarations")
void useContextIfExceptionOccurred(IContextScope* ptr) {
if(std::uncaught_exception()) {
std::ostringstream stream;
@@ -4375,6 +4378,7 @@ namespace detail
contextState->exceptionalContexts.push_back(stream.str());
}
}
+ DOCTEST_GCC_SUPPRESS_WARNING_POP
DOCTEST_MSVC_SUPPRESS_WARNING_POP
void printSummary();
diff --git a/doctest/parts/doctest_fwd.h b/doctest/parts/doctest_fwd.h
index 765641c..ad492b3 100644
--- a/doctest/parts/doctest_fwd.h
+++ b/doctest/parts/doctest_fwd.h
@@ -1469,7 +1469,7 @@ namespace detail
// forbidding some expressions based on this table: http://en.cppreference.com/w/cpp/language/operator_precedence
DOCTEST_FORBIT_EXPRESSION(&)
- DOCTEST_FORBIT_EXPRESSION (^)
+ DOCTEST_FORBIT_EXPRESSION(^)
DOCTEST_FORBIT_EXPRESSION(|)
DOCTEST_FORBIT_EXPRESSION(&&)
DOCTEST_FORBIT_EXPRESSION(||)
@@ -1879,6 +1879,7 @@ namespace detail
Node* tail;
void build(std::ostream* stream) const {
+ DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH("-Wcast-align")
int curr = 0;
// iterate over small buffer
while(curr < numCaptures && curr < DOCTEST_CONFIG_NUM_CAPTURES_ON_STACK)
@@ -1890,6 +1891,7 @@ namespace detail
curr_elem = curr_elem->next;
++curr;
}
+ DOCTEST_GCC_SUPPRESS_WARNING_POP
}
// steal the contents of the other - acting as a move constructor...