Skip to content

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
@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

2 participants