Skip to content

Fix prop_get_version_number leaving present major/minor undefined#975

Draft
v1kko wants to merge 1 commit into
Deltares:mainfrom
v1kko:fm/bugfix/prop_version_intent_out
Draft

Fix prop_get_version_number leaving present major/minor undefined#975
v1kko wants to merge 1 commit into
Deltares:mainfrom
v1kko:fm/bugfix/prop_version_intent_out

Conversation

@v1kko

@v1kko v1kko commented Jun 16, 2026

Copy link
Copy Markdown

Fix prop_get_version_number: never leave a present major/minor undefined

Problem

major and minor are intent(out), optional. The routine returns early in two
places without assigning them:

  • when the version key is absent (prop_get_string fails), and
  • when the value cannot be parsed (get_version_major_minor_integer fails).

If the caller passed major/minor, those arguments are left undefined on
those paths — undefined behaviour on any compiler.

Fix

Initialise the local results to the documented default (version 1.0) and write the
present intent(out) arguments before the early returns, so they always hold a
defined value. The success path continues to overwrite them with the parsed
version.

major and minor are intent(out) optional arguments. The routine returns
early without assigning them when the version key is absent or cannot be
parsed, leaving a present argument undefined for the caller. Initialise
the results to the default version 1.0 and write the present outputs
before the early returns; the success path still overwrites them with the
parsed version.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant