Skip to content

./muduo/net/EventLoopThreadPool.cc:42:14: error: variable length arrays in C++ are a Clang extension #724

Description

@boscowy
FAILED: muduo/net/CMakeFiles/muduo_net.dir/EventLoopThreadPool.cc.o
/home/hwy/llvm-project-18.1.8.src/build/bin/clang++  -I/home/hwy/.xmake/packages/b/boost/1.88.0/afc9e2caad7e4470944d468695c70205/include -I../ -g -DCHECK_PTHREAD_RETURN_VALUE -D_FILE_OFFSET_BITS=64 -Wall -Wextra -Werror -Wconversion -Wno-unused-parameter -Woverloaded-virtual -Wpointer-arith -Wshadow -Wwrite-strings -march=native -std=c++11 -Wno-null-dereference -Wno-sign-conversion -Wno-unused-local-typedef -Wthread-safety -O2 -DNDEBUG -fPIC -MD -MT muduo/net/CMakeFiles/muduo_net.dir/EventLoopThreadPool.cc.o -MF muduo/net/CMakeFiles/muduo_net.dir/EventLoopThreadPool.cc.o.d -o muduo/net/CMakeFiles/muduo_net.dir/EventLoopThreadPool.cc.o -c ../muduo/net/EventLoopThreadPool.cc
../muduo/net/EventLoopThreadPool.cc:42:14: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension]
   42 |     char buf[name_.size() + 32];
      |              ^~~~~~~~~~~~~~~~~
../muduo/net/EventLoopThreadPool.cc:42:14: note: implicit use of 'this' pointer is only allowed within the evaluation of a call to a 'constexpr' member function
1 error generated.
[15/46] Building CXX object muduo/base/CMakeFiles/muduo_base.dir/TimeZone.cc.o
FAILED: muduo/base/CMakeFiles/muduo_base.dir/TimeZone.cc.o
/home/hwy/llvm-project-18.1.8.src/build/bin/clang++  -I/home/hwy/.xmake/packages/b/boost/1.88.0/afc9e2caad7e4470944d468695c70205/include -I../ -g -DCHECK_PTHREAD_RETURN_VALUE -D_FILE_OFFSET_BITS=64 -Wall -Wextra -Werror -Wconversion -Wno-unused-parameter -Woverloaded-virtual -Wpointer-arith -Wshadow -Wwrite-strings -march=native -std=c++11 -Wno-null-dereference -Wno-sign-conversion -Wno-unused-local-typedef -Wthread-safety -O2 -DNDEBUG -fPIC -MD -MT muduo/base/CMakeFiles/muduo_base.dir/TimeZone.cc.o -MF muduo/base/CMakeFiles/muduo_base.dir/TimeZone.cc.o.d -o muduo/base/CMakeFiles/muduo_base.dir/TimeZone.cc.o -c ../muduo/base/TimeZone.cc
../muduo/base/TimeZone.cc:113:14: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension]
  113 |     char buf[n];
      |              ^
../muduo/base/TimeZone.cc:113:14: note: function parameter 'n' with unknown value cannot be used in a constant expression
../muduo/base/TimeZone.cc:111:24: note: declared here
  111 |   string readBytes(int n)
      |                        ^
1 error generated.

Linux distro and version? x86 or ARM? 32-bit or 64-bit?

x86 64-bi6

Branch (cpp98/cpp11/cpp17) and version of muduo?

cpp20 muduo 2022.11.01

Version of cmake, gcc and boost? (If not from distro.)

clang 18.1.8

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions