Commit 000fbf24 authored by Erik Verbruggen's avatar Erik Verbruggen Committed by hjk
Browse files

ValgrindFake: prevent clang static analyzer alarm bells.



The divide by zero is intentional, so suppress the not-quite-so-false
positive from appearing.

Change-Id: Iba96682e5b584a7e4a8e5895af0ccfc68b73cc71
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 1f53ecd8
......@@ -108,9 +108,11 @@ void OutputGenerator::produceRuntimeError()
{
if (m_crash) {
std::cerr << "Goodbye, cruel world" << std::endl;
#ifndef __clang_analyzer__
int zero = 0; // hide the error at compile-time to avoid a compiler warning
int i = 1 / zero;
Q_UNUSED(i);
#endif
Q_ASSERT(false);
} else if (m_garbage) {
std::cerr << "Writing garbage" << std::endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment