public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/111884] New: unsigned char no longer aliases anything under -std=c2x
@ 2023-10-19 20:02 amonakov at gcc dot gnu.org
  2023-10-19 20:19 ` [Bug c/111884] " sjames at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: amonakov at gcc dot gnu.org @ 2023-10-19 20:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111884

            Bug ID: 111884
           Summary: unsigned char no longer aliases anything under
                    -std=c2x
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: amonakov at gcc dot gnu.org
  Target Milestone: ---

int f(int i)
{
    int f = 1;
    return i[(unsigned char *)&f];
}
int g(int i)
{
    int f = 1;
    return i[(signed char *)&f];
}
int h(int i)
{
    int f = 1;
    return i[(char *)&f];
}


gcc -O2 -std=c2x compiles 'f' as though inspecting representation via an
'unsigned char *' is not valid (with a confusing warning under -Wall).

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-10-20 19:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-19 20:02 [Bug c/111884] New: unsigned char no longer aliases anything under -std=c2x amonakov at gcc dot gnu.org
2023-10-19 20:19 ` [Bug c/111884] " sjames at gcc dot gnu.org
2023-10-19 20:23 ` joseph at codesourcery dot com
2023-10-19 20:30 ` mpolacek at gcc dot gnu.org
2023-10-19 20:39 ` [Bug c/111884] [13/14 Regression] " pinskia at gcc dot gnu.org
2023-10-19 20:57 ` tom at honermann dot net
2023-10-20  6:51 ` rguenth at gcc dot gnu.org
2023-10-20 19:37 ` cvs-commit at gcc dot gnu.org
2023-10-20 19:40 ` cvs-commit at gcc dot gnu.org
2023-10-20 19:40 ` mpolacek at gcc dot gnu.org

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).