-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[Flang][runtime] Fix RENAME intrinsic, remove trailing blanks #159123
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
664be1d
[Flang][runtime] Fix RENAME intrinsic, remove trailing blanks
mjklemm b20d0ab
Update flang-rt/lib/runtime/misc-intrinsic.cpp
mjklemm 6827079
Introduce function IsNullTerminated
mjklemm 8b60514
Add proper handling of null-terminated character strings
mjklemm 8e9305e
Remove sizeof
mjklemm 58cbad6
Revert "Introduce function IsNullTerminated"
mjklemm b5101da
Simplify code
mjklemm 14cbc44
Cleanup
mjklemm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File names in most unix-like filesystems can have trailing spaces. I think it's the caller that should make sure the names are correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do agree with that sentiment, but this implements the semantics of GFortran with this PR: https://gcc.gnu.org/onlinedocs/gfortran/RENAME.html.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kparzysz, note that you can still deal with blank terminated files on UNIX system after this patch by using
rename("test_trailing "//char(0), "new_name "//char(0)).This is consistent not only with gfortran, but also with IFX and nvfortran/classic flang implementations. Given this is a legacy lib3f intrinsic, we must stick to the existing behaviors here.