Skip to content

Commit

Permalink
Suppress -Wzero-length-array
Browse files Browse the repository at this point in the history
Summary: Suppress a `-Wzero-length-array` warning when building with `arvr/mode/platform010`.

Reviewed By: h-friederich

Differential Revision: D62024034

fbshipit-source-id: 510cc828ba7bfe3d49b18e8c56808ed861421d39
  • Loading branch information
Gabriel Agamennoni authored and facebook-github-bot committed Sep 4, 2024
1 parent 4138f29 commit 5990e34
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions folly/Subprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,13 +571,16 @@ void Subprocess::closeInheritedFds(const Options::FdMap& fdActions) {
// We do not use the POSIX interfaces (opendir, readdir, etc..) for
// reading a directory since they may allocate memory / grab a lock, which
// is unsafe in this context.
FOLLY_PUSH_WARNING
FOLLY_CLANG_DISABLE_WARNING("-Wzero-length-array")
struct linux_dirent64 {
uint64_t d_ino;
int64_t d_off;
uint16_t d_reclen;
unsigned char d_type;
char d_name[0];
} const* entry;
FOLLY_POP_WARNING
for (int offset = 0; offset < res; offset += entry->d_reclen) {
entry = reinterpret_cast<struct linux_dirent64*>(buffer + offset);
if (entry->d_type != DT_LNK) {
Expand Down

0 comments on commit 5990e34

Please sign in to comment.