Skip to content

Commit 65861fb

Browse files
committed
Warning when more #if than #endif statements
When more `#endif``s present than `#if`s we got a warning, but not wen it is the other way around.
1 parent 33a89a6 commit 65861fb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/pre.l

+5
Original file line numberDiff line numberDiff line change
@@ -4069,6 +4069,11 @@ void Preprocessor::processFile(const QCString &fileName,const std::string &input
40694069
// make sure we don't extend a \cond with missing \endcond over multiple files (see bug 624829)
40704070
forceEndCondSection(yyscanner);
40714071

4072+
if (!state->levelGuard.empty())
4073+
{
4074+
warn(state->fileName,state->yyLineNr,"More #if's than #endif's found (might be in an included file).");
4075+
}
4076+
40724077
if (Debug::isFlagSet(Debug::Preprocessor))
40734078
{
40744079
std::lock_guard<std::mutex> lock(g_debugMutex);

0 commit comments

Comments
 (0)