Files
ResInsight/Fwk/VizFwk
Magne Sjaastad d0e9f45f32 #14397 Make cvfAssert.h self-contained
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.
2026-08-07 15:05:57 +02:00
..
2024-01-09 14:38:57 +01:00
2024-01-09 14:38:57 +01:00
2024-01-09 14:38:57 +01:00
2024-10-28 13:09:18 +01:00
2024-01-09 14:38:57 +01:00