Message ID | 20220719222950.540619-2-prestwoj@gmail.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
Series | [1/2] unit: memset band to zero after alloc | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
prestwoj/iwd-ci-gitlint | fail | [2/2] wiphy: fix strange compiler bug with gcc 11.2 14: B1 Line exceeds max length (134>80): "/usr/include/bits/string_fortified.h:59:10: error: ‘__builtin_memset’ offset [0, 7] is out of the bounds [0, 0] [-Werror=array-bounds]" |
diff --git a/src/wiphy.c b/src/wiphy.c index a52d0941..4dcfb8b3 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -1187,7 +1187,15 @@ static struct band *band_new_from_message(struct l_genl_attr *band) toalloc = sizeof(struct band) + count * sizeof(uint8_t); ret = l_malloc(toalloc); memset(ret, 0, toalloc); + +#if __GNUC__ == 11 && __GNUC_MINOR__ == 2 +_Pragma("GCC diagnostic push") +_Pragma("GCC diagnostic ignored \"-Warray-bounds\"") +#endif memset(ret->vht_mcs_set, 0xff, sizeof(ret->vht_mcs_set)); +#if __GNUC__ == 11 && __GNUC_MINOR__ == 2 +_Pragma("GCC diagnostic pop") +#endif return ret; }