public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/94692] New: Zero-sized arrays shouldn't require a complete element type
@ 2020-04-21 14:25 sasho648 at gmail dot com
  2020-04-21 15:04 ` [Bug c/94692] " pinskia at gcc dot gnu.org
  2020-04-21 15:05 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: sasho648 at gmail dot com @ 2020-04-21 14:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94692
           Summary: Zero-sized arrays shouldn't require a complete element
                    type
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sasho648 at gmail dot com
  Target Milestone: ---

Because they don't reserve any storage.

union db { union dd dd[0]; unsigned char udb; signed char sdb; } *ptr;
union dd { union db db[0]; unsigned long udd; signed long sdd; } 

data = *(ptr+0x3B)->dd;

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

* [Bug c/94692] Zero-sized arrays shouldn't require a complete element type
  2020-04-21 14:25 [Bug c/94692] New: Zero-sized arrays shouldn't require a complete element type sasho648 at gmail dot com
@ 2020-04-21 15:04 ` pinskia at gcc dot gnu.org
  2020-04-21 15:05 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-04-21 15:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
https://gcc.gnu.org/onlinedocs/gcc-9.3.0/gcc/Zero-Length.html#Zero-Length

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

* [Bug c/94692] Zero-sized arrays shouldn't require a complete element type
  2020-04-21 14:25 [Bug c/94692] New: Zero-sized arrays shouldn't require a complete element type sasho648 at gmail dot com
  2020-04-21 15:04 ` [Bug c/94692] " pinskia at gcc dot gnu.org
@ 2020-04-21 15:05 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-04-21 15:05 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement

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

end of thread, other threads:[~2020-04-21 15:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21 14:25 [Bug c/94692] New: Zero-sized arrays shouldn't require a complete element type sasho648 at gmail dot com
2020-04-21 15:04 ` [Bug c/94692] " pinskia at gcc dot gnu.org
2020-04-21 15:05 ` 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).