mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
cvfAssert.h tests CVF_ENABLE_ASSERTS but did not include cvfConfigCore.h, which is where that macro gets its default value of 1. A translation unit processing cvfAssert.h before cvfConfigCore.h evaluated the undefined identifier as 0 and silently compiled every CVF_ASSERT, CVF_ASSERT_MSG and CVF_FAIL_MSG in that unit into a no-op, without any warning and without evaluating the expressions. Because the header uses pragma once, including cvfConfigCore.h later in the same unit did not recover the macros. Alphabetical include sorting actively produces the broken order, since cvfAssert.h sorts before cvfBase.h. Include cvfConfigCore.h before the macro definitions. It only defines macros, has pragma once and no dependencies, so this is immune to future include reordering. This turns the asserts back on in the affected translation units, in both debug and release builds, and immediately exposed one assert that had never compiled: in RigFemPartResultCalculatorNormalized::calculate, isNormalizableResult was called unqualified even though it is a static member of RigFemPartResultsCollection. Qualify it, matching isMatching in the same file.