public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/21664] array-of-empty-structure extension not properly defined
       [not found] <bug-21664-4@http.gcc.gnu.org/bugzilla/>
@ 2014-03-20  7:27 ` mpolacek at gcc dot gnu.org
  2014-04-18 20:57 ` mpolacek at gcc dot gnu.org
  1 sibling, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-03-20  7:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21664

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Testcase in #c0 is now rejected.


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

* [Bug c/21664] array-of-empty-structure extension not properly defined
       [not found] <bug-21664-4@http.gcc.gnu.org/bugzilla/>
  2014-03-20  7:27 ` [Bug c/21664] array-of-empty-structure extension not properly defined mpolacek at gcc dot gnu.org
@ 2014-04-18 20:57 ` mpolacek at gcc dot gnu.org
  1 sibling, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-04-18 20:57 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21664

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
...so marking as "fixed".


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

* [Bug c/21664] array-of-empty-structure extension not properly defined
       [not found] <bug-21664-10053@http.gcc.gnu.org/bugzilla/>
@ 2005-10-25 19:47 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-25 19:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2005-10-25 19:47 -------
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-10-25 19:47:54
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21664


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

* [Bug c/21664] array-of-empty-structure extension not properly defined
  2005-05-19 14:02 [Bug c/21664] New: " rguenth at gcc dot gnu dot org
  2005-05-19 19:55 ` [Bug c/21664] " gdr at integrable-solutions dot net
@ 2005-05-19 20:20 ` rguenth at gcc dot gnu dot org
  1 sibling, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-05-19 20:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at gcc dot gnu dot org  2005-05-19 20:20 -------
None.  But I have to deal with the possibilities of these during folding
of &a[2] == &a[1].  At least until the middle-end makes a promise that
they cannot exist (which they do), or the C frontend rejects this.  It's
really a question for advice on details of our own extension to the C language.

Richard.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21664


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

* [Bug c/21664] array-of-empty-structure extension not properly defined
  2005-05-19 14:02 [Bug c/21664] New: " rguenth at gcc dot gnu dot org
@ 2005-05-19 19:55 ` gdr at integrable-solutions dot net
  2005-05-19 20:20 ` rguenth at gcc dot gnu dot org
  1 sibling, 0 replies; 5+ messages in thread
From: gdr at integrable-solutions dot net @ 2005-05-19 19:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at integrable-solutions dot net  2005-05-19 19:45 -------
Subject: Re:  New: array-of-empty-structure extension not properly defined

"rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| For
| 
| struct {} a[4]; int main() { return &a[2] - &a[1]; }
| 
| the C frontend emits
| 
|   return 0 /[ex] 0;
| 
| which will, at -O0 fault at runtime, at -O not due to RTL CSE.
| 
| Is this even well-defined?

No, as you noted below.

|  Should the C-frontend rather emit
| 
|  return 0;
| 
| ?  Of course this contradicts the C standard, but that does not
| allow empty structures anyway.

If you go back to the GCC mailing list (circa 2001, 2002), you'll see
heavy and hot debates about what the answer should be.
For that matter, the C++ standards allow empty structures but do not
allow "return 0".  I suppose the real question is what use do you have
for an array of empty structures.

-- Gaby


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21664


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

end of thread, other threads:[~2014-04-18 20:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-21664-4@http.gcc.gnu.org/bugzilla/>
2014-03-20  7:27 ` [Bug c/21664] array-of-empty-structure extension not properly defined mpolacek at gcc dot gnu.org
2014-04-18 20:57 ` mpolacek at gcc dot gnu.org
     [not found] <bug-21664-10053@http.gcc.gnu.org/bugzilla/>
2005-10-25 19:47 ` pinskia at gcc dot gnu dot org
2005-05-19 14:02 [Bug c/21664] New: " rguenth at gcc dot gnu dot org
2005-05-19 19:55 ` [Bug c/21664] " gdr at integrable-solutions dot net
2005-05-19 20:20 ` rguenth at gcc dot gnu dot 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).