-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[flang] Implement external routine usage of hostnm() #134900
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
Conversation
modified: flang-rt/lib/runtime/extensions.cpp
modified: flang-rt/lib/runtime/extensions.cpp modified: flang/include/flang/Runtime/extensions.h
✅ With the latest revision this PR passed the C/C++ code formatter. |
flang-rt/lib/runtime/extensions.cpp
Outdated
@@ -264,6 +264,43 @@ int RTNAME(Chdir)(const char *name) { | |||
#endif | |||
} | |||
|
|||
int FORTRAN_PROCEDURE_NAME(hostnm)(char *hn, int length) { | |||
|
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.
This would be a lot easier to read if it wasn't so needlessly stretched out vertically by all these blank lines.
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.
Removed some blank lines.
flang-rt/lib/runtime/extensions.cpp
Outdated
if (status == 0) { | ||
// Find zero terminator and fill the string from the | ||
// zero terminator to the end with spaces | ||
char *str_end = hn + length; |
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.
Always use braced initialization in the runtime and other modern C++ directories, please.
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.
Done
Previously, `hostnm` extended intrinsic was implemented as proper intrinsic. Since then we found out that some applications use `hostnm` as external routine via `external hostnm`. This prevents `hostnm` from being recognized as an intrinsic. This PR implements `hostnm` as external routine.
Previously,
hostnm
extended intrinsic was implemented as proper intrinsic. Since then we found out that some applications usehostnm
as external routine viaexternal hostnm
. This preventshostnm
from being recognized as an intrinsic. This PR implementshostnm
as external routine.