solstice-solver

Solver library of the solstice app
git clone git://git.meso-star.com/solstice-solver.git
Log | Files | Refs | README | LICENSE

commit a7b1d8c0832a52cb9ea403ceb37d198eb701a030
parent 239c52ad4a444bd02bb02b166539e2f5ec80719b
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon,  7 Sep 2026 14:54:12 +0200

Disable a warning "may be used uninitialized"

This warning appears to be a false positive of GCC 15.

Indeed, a tight review of the code and several tests seem to confirm
that there is no situation where the incriminating variable could be
used while it is not initialized. This commit therefore bypasses this
warning by initializing this variable (actually, the structure that
contains it as a member) to 0 as soon as it is defined.

Diffstat:
Msrc/ssol_solver.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ssol_solver.c b/src/ssol_solver.c @@ -881,7 +881,7 @@ trace_radiative_path struct ranst_sun_wl* ran_sun_wl, const struct ssol_path_tracker* tracker) /* May be NULL */ { - struct path path; + struct path path = {0}; struct ssol_medium in_medium = SSOL_MEDIUM_VACUUM; struct ssol_medium out_medium = SSOL_MEDIUM_VACUUM; struct s3d_hit hit = S3D_HIT_NULL;