This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/26581] incomplete (unsized) static array types cannot be completed
- From: "bernard at brenda-arkle dot demon dot co dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Mar 2006 18:35:54 -0000
- Subject: [Bug c/26581] incomplete (unsized) static array types cannot be completed
- References: <bug-26581-12315@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from bernard at brenda-arkle dot demon dot co dot uk 2006-03-06 18:35 -------
Thanks - I'd forgotten that 'static' declarations can be
tentative definitions too. But now I'm even more confused!
As I wrote, unsized arrays do one thing, undefined structs do another
(this is a "gcc fact" whatever its ANSI-legal status).
Consider this:
struct poo; /* declares an incomplete structure type, 6.7.2.3 para. 7 */
static struct poo thingy; /* a tentative definition, 6.9.2 para. 2 */
/* The structure type is still incomplete, 6.7.2.3 para. 3 */
/* any subsequent definition of struct poo is too late */
Shouldn't this now be flagged as an error, at least if '-pedantic'
is requested?
If I'm wrong again about this, I'll shut up...
Bernard Leak
--
I remember when the Standard had fewer than 8 bits' worth of confusing pages!
--
bernard at brenda-arkle dot demon dot co dot uk changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26581