Skip to content

Make code conform with Fortran standard #134

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

Closed
wants to merge 1 commit into from

Conversation

Leporacanthicus
Copy link
Contributor

The original test "writes" to the argument a of s1, which is a constant value. This isn't valid in Fortran, and will fail if constant values are placed in read-only memory.

The original bug-report wasn't about using a constant argument to a function, but simply that the assign to doesn't work for some cases.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=22290

This patch fixes the test-code so that it is compliant with Fortran standard, by introducing a variable to assign into.

The original test "writes" to the argument a of s1, which is a
constant value. This isn't valid in Fortran, and will fail
if constant values are placed in read-only memory.

The original bug-report wasn't about using a constant
argument to a function, but simply that the assign to
doesn't work for some cases.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=22290

This patch fixes the test-code so that it is compliant
with Fortran standard, by introducing a variable to
assign into.
@Leporacanthicus
Copy link
Contributor Author

At some point, we probably should bring this back to the gcc folks! :)

Copy link
Contributor

@tblah tblah left a comment

Choose a reason for hiding this comment

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

Agreed. Writing to a literal constant is non-conforming.

@tarunprabhu
Copy link
Contributor

For both the GCC and gfortran test suites, we do not make any changes to the tests themselves. This originally was borne out of licensing concerns. I am not particularly keen on changing this stance.

We have some end to end tests in Fortran/UnitTests. We could add a test like this there. Fortran/UnitTests/hello is an example.

For this particular test, we should just disable it.

@Leporacanthicus
Copy link
Contributor Author

For both the GCC and gfortran test suites, we do not make any changes to the tests themselves. This originally was borne out of licensing concerns. I am not particularly keen on changing this stance.

We have some end to end tests in Fortran/UnitTests. We could add a test like this there. Fortran/UnitTests/hello is an example.

For this particular test, we should just disable it.

Ok, I'll add it to the "disable test" list and add something similar to the unit tests.

@Leporacanthicus
Copy link
Contributor Author

Closing, new PR #135 to replace this one.

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.

3 participants