]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix build with clang v18 [-Wvla-cxx-extension] (#1813) (#1817)
authorsquidadm <squidadm@users.noreply.github.com>
Tue, 21 May 2024 20:46:47 +0000 (08:46 +1200)
committerGitHub <noreply@github.com>
Tue, 21 May 2024 20:46:47 +0000 (21:46 +0100)
src/fs/rock/RockRebuild.cc:356:17: error: variable length arrays
    in C++ are a Clang extension [-Werror,-Wvla-cxx-extension]
        char hdrBuf[SwapDir::HeaderSize];
    note: initializer of 'HeaderSize' is unknown

Co-authored-by: Francesco Chemolli <5175948+kinkie@users.noreply.github.com>
src/fs/rock/RockSwapDir.cc
src/fs/rock/RockSwapDir.h

index 111a89e649bb9e06ee0ca435430600803c5988c8..37e8299bbde802183e9215b9f4eddb7dc7dd1474 100644 (file)
@@ -37,8 +37,6 @@
 #include <sys/stat.h>
 #endif
 
-const int64_t Rock::SwapDir::HeaderSize = 16*1024;
-
 Rock::SwapDir::SwapDir(): ::SwapDir("rock"),
     slotSize(HeaderSize), filePath(nullptr), map(nullptr), io(nullptr),
     waitingForPage(nullptr)
index 53079a833fa61e61db1c3e57925087a7c0ab9e5b..ef6d9b6e73d17ea7699fecf8ceb61826d5e52339 100644 (file)
@@ -148,7 +148,7 @@ private:
     /* configurable options */
     DiskFile::Config fileConfig; ///< file-level configuration options
 
-    static const int64_t HeaderSize; ///< on-disk db header size
+    static const int64_t HeaderSize = 16*1024; ///< on-disk db header size
 };
 
 /// initializes shared memory segments used by Rock::SwapDir