diff options
author | Laurent Vivier <lvivier@redhat.com> | 2025-05-13 11:40:59 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2025-05-14 17:51:20 +0200 |
commit | 570e7b4454f2f879180ae3ca13dedd759aff5243 (patch) | |
tree | 5969e36e1af201eca34eeb5b263b813e4e8f4ca0 | |
parent | 8ec134109eb136432a29bdf5a14f8b1fd4e46208 (diff) | |
download | passt-570e7b4454f2f879180ae3ca13dedd759aff5243.tar passt-570e7b4454f2f879180ae3ca13dedd759aff5243.tar.gz passt-570e7b4454f2f879180ae3ca13dedd759aff5243.tar.bz2 passt-570e7b4454f2f879180ae3ca13dedd759aff5243.tar.lz passt-570e7b4454f2f879180ae3ca13dedd759aff5243.tar.xz passt-570e7b4454f2f879180ae3ca13dedd759aff5243.tar.zst passt-570e7b4454f2f879180ae3ca13dedd759aff5243.zip |
dhcpv6: fix GCC error (unterminated-string-initialization)
The string STR_NOTONLINK is intentionally not NUL-terminated.
Ignore the GCC error using __attribute__((nonstring)).
This error is reported by GCC 15.1.1 on Fedora 42. However,
Clang 20.1.3 does not support __attribute__((nonstring)).
Therefore, NOLINTNEXTLINE(clang-diagnostic-unknown-attributes)
is also added to suppress Clang's unknown attribute warning.
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | dhcpv6.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -144,7 +144,9 @@ struct opt_ia_addr { struct opt_status_code { struct opt_hdr hdr; uint16_t code; - char status_msg[sizeof(STR_NOTONLINK) - 1]; + /* "nonstring" is only supported since clang 23 */ + /* NOLINTNEXTLINE(clang-diagnostic-unknown-attributes) */ + __attribute__((nonstring)) char status_msg[sizeof(STR_NOTONLINK) - 1]; } __attribute__((packed)); /** |