Skip to content

Commit

Permalink
Fix -Wgnu-variable-sized-type-not-at-end errors across fbcode (#332)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #332

Newer versions of the kernel have moved to flexible array members,
which triggers compiler warnings with the pattern used here.

https://patchwork.kernel.org/project/linux-nvdimm/patch/20220627180432.GA136081@embeddedor/

Reviewed By: psaab

Differential Revision: D67374150

fbshipit-source-id: 7b269d8d006d5ad6abe1d5df981c2247f6330220
  • Loading branch information
andrewjcg authored and facebook-github-bot committed Dec 18, 2024
1 parent a73b884 commit 3c341d8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dynolog/src/rdmamon/EthtoolCounters.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ class EthtoolCounters {

[[nodiscard]] bool setup_ethtool_counters(
const std::vector<std::string>& eth_counter_names_) {
struct {
union {
struct ethtool_sset_info hdr;
uint32_t buf[1];
// Allocate extra space for flexible array member.
uint8_t
_buf[offsetof(struct ethtool_sset_info, data) + sizeof(uint32_t[1])];
} ss_stats;
uint32_t ss_stats_len;

Expand Down

0 comments on commit 3c341d8

Please sign in to comment.