public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/users/aoliva/heads/testme)] testsuite: discard c++ exclusion on underaligned pointer warning
Date: Sun, 19 Nov 2023 08:19:04 +0000 (GMT)	[thread overview]
Message-ID: <20231119081904.D2BD63858403@sourceware.org> (raw)

https://gcc.gnu.org/g:bec44fdc5bfdca7c538f3508a3d987f28c0e9613

commit bec44fdc5bfdca7c538f3508a3d987f28c0e9613
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Sun Nov 19 01:26:50 2023 -0300

    testsuite: discard c++ exclusion on underaligned pointer warning
    
    Having extended check_and_warn_address_or_pointer_of_packed_member to
    find the packed (short) enum pointer in the cast expression coming
    from the C++ front-end, and amended the C++ front end to mark short
    enums as TYPE_PACKED, C++ issues the same warning that C does for
    c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c,
    so drop the exclusion.
    
    
    for  gcc/testsuite/ChangeLog
    
            * c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c:
            Expect warning in C++ as well.
            * c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c:
            Likewise.

Diff:
---
 .../analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c        | 2 +-
 .../analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c           | 2 +-
 2 files changed, 2 insertions(+), 2 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 aaa2031b6dc..bf5bf5cc2e2 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))); /* { dg-warning "unaligned pointer value" "warning" { target { short_enums && { ! c++ } } } } */
+ return ((struct connection *)(((char *)(t)) - ((long)&((struct connection *)0)->obj_type))); /* { dg-warning "unaligned pointer value" "warning" { target short_enums } } */
 }
 static inline struct connection *objt_conn(enum obj_type *t)
 {
diff --git a/gcc/testsuite/c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c b/gcc/testsuite/c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c
index 6c96f5a76ef..7c2710c64d3 100644
--- a/gcc/testsuite/c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c
+++ b/gcc/testsuite/c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c
@@ -60,7 +60,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))); /* { dg-warning "unaligned pointer value" "warning" { target { short_enums && { ! c++ } } } } */
+ return ((struct connection *)(((char *)(t)) - ((long)&((struct connection *)0)->obj_type))); /* { dg-warning "unaligned pointer value" "warning" { target short_enums } } */
 }
 static inline struct connection *objt_conn(enum obj_type *t)
 {

             reply	other threads:[~2023-11-19  8:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-19  8:19 Alexandre Oliva [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-11-29  4:38 Alexandre Oliva
2023-11-23 11:46 Alexandre Oliva
2023-11-19  8:32 Alexandre Oliva
2023-11-19  8:11 Alexandre Oliva
2023-11-19  7:02 Alexandre Oliva
2023-11-19  6:31 Alexandre Oliva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231119081904.D2BD63858403@sourceware.org \
    --to=aoliva@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).