diff options
author | Torbjörn SVENSSON <torbjorn.svensson@foss.st.com> | 2024-03-13 15:04:25 +0100 |
---|---|---|
committer | Torbjörn SVENSSON <torbjorn.svensson@foss.st.com> | 2024-03-13 15:16:44 +0100 |
commit | 5a44e14eb4ff47317b420de10fcc2512a6a6e0fb (patch) | |
tree | 6c05ff4b91da1c51637692e57ea00447401606da | |
parent | 4d049fadc25585e336c06e6b60b592f40ddbcc12 (diff) | |
download | gcc-5a44e14eb4ff47317b420de10fcc2512a6a6e0fb.zip gcc-5a44e14eb4ff47317b420de10fcc2512a6a6e0fb.tar.gz gcc-5a44e14eb4ff47317b420de10fcc2512a6a6e0fb.tar.bz2 |
testsuite: target test for short_enums
On arm-none-eabi, the test case fails with below warning on GCC13
.../null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c:63:65: warning: converting a packed 'enum obj_type' pointer (alignment 1) to a 'struct connection' pointer (alignment 4) may result in an unaligned pointer value [-Waddress-of-packed-member]
Add a dg-bogus to ensure that the warning is not reintroduced.
gcc/testsuite/ChangeLog:
* c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c:
Added dg-bogus with target on offending line for short_enums.
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
-rw-r--r-- | gcc/testsuite/c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/testsuite/c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c b/gcc/testsuite/c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c index c1c8e6f..a37962f 100644 --- a/gcc/testsuite/c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c +++ b/gcc/testsuite/c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c @@ -61,7 +61,7 @@ static inline enum obj_type obj_type(const enum obj_type *t) } static inline struct connection *__objt_conn(enum obj_type *t) { - return ((struct connection *)(((char *)(t)) - ((long)&((struct connection *)0)->obj_type))); + return ((struct connection *)(((char *)(t)) - ((long)&((struct connection *)0)->obj_type))); /* { dg-bogus "may result in an unaligned pointer value" "Fixed in r14-6517-gb7e4a4c626e" { target short_enums } } */ } static inline struct connection *objt_conn(enum obj_type *t) { |