aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
diff options
context:
space:
mode:
authorRainer Orth <ro@gcc.gnu.org>2024-01-11 16:08:43 +0100
committerGitHub <noreply@github.com>2024-01-11 16:08:43 +0100
commit731b29560d02f21210d2224226dd5378afa5090f (patch)
tree858c36c801fc1d1125d8dd6a1ba47ebf8e712d41 /llvm/lib/Bitcode/Reader/MetadataLoader.cpp
parent18473eb108e29c7c9d9fcb5d0d8c271948aca330 (diff)
downloadllvm-731b29560d02f21210d2224226dd5378afa5090f.zip
llvm-731b29560d02f21210d2224226dd5378afa5090f.tar.gz
llvm-731b29560d02f21210d2224226dd5378afa5090f.tar.bz2
[flang] Handle missing LOGIN_NAME_MAX definition in runtime (#77775)
18af032c0e16252effeb6dfd02113812388f1d31 broke the Solaris build: ``` /vol/llvm/src/llvm-project/dist/flang/runtime/extensions.cpp:60:24: error: use of undeclared identifier 'LOGIN_NAME_MAX' 60 | const int nameMaxLen{LOGIN_NAME_MAX + 1}; | ^ /vol/llvm/src/llvm-project/dist/flang/runtime/extensions.cpp:61:12: warning: variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension] 61 | char str[nameMaxLen]; | ^~~~~~~~~~ /vol/llvm/src/llvm-project/dist/flang/runtime/extensions.cpp:61:12: note: initializer of 'nameMaxLen' is unknown /vol/llvm/src/llvm-project/dist/flang/runtime/extensions.cpp:60:13: note: declared here 60 | const int nameMaxLen{LOGIN_NAME_MAX + 1}; | ^ ``` `flang/unittests/Runtime/CommandTest.cpp` has the same issue. As documented in Solaris 11.4 `limits.h(3HEAD)`, `LOGIN_NAME_MAX` can be undefined. To determine the value, `sysconf(3C)` needs to be used instead. Beside that portable method, Solaris also provides a non-standard `LOGNAME_MAX` which could be used, but I've preferred the standard route instead which would support other targets with the same issue. Tested on `amd64-pc-solaris2.11` and `x86_64-pc-linux-gnu`.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/MetadataLoader.cpp')
0 files changed, 0 insertions, 0 deletions