Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #706 - failure due unassigned value to a intent(out) variable. #708

Merged
merged 2 commits into from May 5, 2023

Conversation

14NGiestas
Copy link
Member

Fixes #709 as proposed by @degawa
I just moved the assignment to the start of the routine so its clear that if nothing changes that stat variable, it defaults to zero.

Co-authored-by: degawa <degawa.tomohiro@gmail.com>
@14NGiestas 14NGiestas added bug Something isn't working compiler: nagfor Specific to NAG Fortran compiler labels May 4, 2023
@14NGiestas 14NGiestas self-assigned this May 4, 2023
Copy link
Member

@jvdp1 jvdp1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this only for nagfor?
OK otherwise for merging.

@14NGiestas
Copy link
Member Author

Is this only for nagfor? OK otherwise for merging.

It was revealed by nagfor but it seems a fix that is general enough as per Fortran standard, as stat isn't default-initialized.

I quote the issue #706 here:

In parse_header, stat is not assigned any value if no error occurs. stat having the intent(out) attribute may become undefined according to the Fortran standard:

The INTENT (OUT) attribute for a nonpointer dummy argument specifies that the dummy argument becomes undefined on invocation of the procedure, except for any subcomponents that are default-initialized (7.5.4.6).

@14NGiestas 14NGiestas removed the compiler: nagfor Specific to NAG Fortran compiler label May 4, 2023
@jvdp1
Copy link
Member

jvdp1 commented May 5, 2023

Thank you for the fix. I'll merge it.

@jvdp1 jvdp1 merged commit c004bbe into master May 5, 2023
29 checks passed
@jvdp1 jvdp1 deleted the 14NGiestas-patch-2 branch May 5, 2023 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

spurious failure of parse_header in load_npy due to no value assigned to an intent(out) argument.
2 participants