diff --git a/platform/linux-generic/pktio/stats/ethtool_stats.c b/platform/linux-generic/pktio/stats/ethtool_stats.c index 9569ac05319..7e37da69580 100644 --- a/platform/linux-generic/pktio/stats/ethtool_stats.c +++ b/platform/linux-generic/pktio/stats/ethtool_stats.c @@ -40,7 +40,10 @@ static struct ethtool_gstrings *get_stringset(int fd, struct ifreq *ifr) hdr.sset_mask = 1ULL << ETH_SS_STATS; ifr->ifr_data = (void *)&hdr; if (ioctl(fd, SIOCETHTOOL, ifr) == 0) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" len = hdr.sset_mask ? hdr.data[0] : 0; +#pragma GCC diagnostic pop } else if (errno == EOPNOTSUPP && drvinfo_offset != 0) { /* Fallback for old kernel versions */ drvinfo.cmd = ETHTOOL_GDRVINFO;