Skip to content

Commit

Permalink
Fix build with clang v18 [-Wvla-cxx-extension] (squid-cache#1813)
Browse files Browse the repository at this point in the history
    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
  • Loading branch information
kinkie committed Jun 9, 2024
1 parent c77a7ea commit 0189e42
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/fs/rock/RockSwapDir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/fs/rock/RockSwapDir.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class SwapDir: public ::SwapDir, public IORequestor, public Ipc::StoreMapCleaner
/* 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
Expand Down

0 comments on commit 0189e42

Please sign in to comment.