Skip to content

Commit

Permalink
[flang] Fix a warning
Browse files Browse the repository at this point in the history
This patch fixes:

  flang/unittests/Runtime/CommandTest.cpp:702:14: error: variable
  length arrays are a C99 feature [-Werror,-Wvla-extension]
  • Loading branch information
kazutakahirata committed Jan 11, 2024
1 parent cf3421d commit fb09447
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flang/unittests/Runtime/CommandTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,10 +699,10 @@ TEST_F(EnvironmentVariables, GetlogPadSpace) {
if (charLen == -1)
charLen = _POSIX_LOGIN_NAME_MAX + 2;
#endif
char input[charLen];
std::vector<char> input(charLen);

FORTRAN_PROCEDURE_NAME(getlog)
(reinterpret_cast<std::byte *>(input), charLen);
(reinterpret_cast<std::byte *>(input.data()), charLen);

EXPECT_EQ(input[charLen - 1], ' ');
}
Expand Down

0 comments on commit fb09447

Please sign in to comment.