public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/109526] New: Broken type name for anonymous struct containing a VLA member in diagnostic message
@ 2023-04-15 15:51 xry111 at gcc dot gnu.org
  2023-04-15 19:22 ` [Bug c/109526] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-04-15 15:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109526
           Summary: Broken type name for anonymous struct containing a VLA
                    member in diagnostic message
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xry111 at gcc dot gnu.org
  Target Milestone: ---

void test(__SIZE_TYPE__ len, char *x)
{
    struct
    {
        char data[len];
    } *p = x;
}

The diagnostic message is:

<source>: In function 'test':
<source>:6:12: warning: initialization of '<U87b8> *' from incompatible pointer
type 'char *' [-Wincompatible-pointer-types]
    6 |     } *p = x;
      |            ^

"<U87b8>" does not make any sense to me.

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

* [Bug c/109526] Broken type name for anonymous struct containing a VLA member in diagnostic message
  2023-04-15 15:51 [Bug c/109526] New: Broken type name for anonymous struct containing a VLA member in diagnostic message xry111 at gcc dot gnu.org
@ 2023-04-15 19:22 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-15 19:22 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-04-15

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
If it was not a VLA type inside the struct we get:

<source>:7:12: warning: initialization of 'struct <anonymous> *' from
incompatible pointer type 'char *' [-Wincompatible-pointer-types]
    7 |     } *p = x;
      |            ^

Which seems better.

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

end of thread, other threads:[~2023-04-15 19:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-15 15:51 [Bug c/109526] New: Broken type name for anonymous struct containing a VLA member in diagnostic message xry111 at gcc dot gnu.org
2023-04-15 19:22 ` [Bug c/109526] " pinskia 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).