public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/10207: Empty structure initialization fails under C++ (but works under C)
@ 2003-03-26 1:46 David R. Whipple
0 siblings, 0 replies; 3+ messages in thread
From: David R. Whipple @ 2003-03-26 1:46 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/10207; it has been noted by GNATS.
From: "David R. Whipple" <vencain@swbell.net>
To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org,
gcc-prs@gcc.gnu.org
Cc:
Subject: Re: c++/10207: Empty structure initialization fails under C++ (but
works under C)
Date: Tue, 25 Mar 2003 17:50:02 -0600
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10207
I've subsequently noticed that the sizeof() returns zero for an empty C
structure while returning one under C++, presumably playing a role in
this problem. Is there a mechanism to encourage C++ to collapse an
empty structure to zero bytes? If so then perhaps that would circumvent
the reported problem.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/10207: Empty structure initialization fails under C++ (but works under C)
@ 2003-03-25 16:06 bangerth
0 siblings, 0 replies; 3+ messages in thread
From: bangerth @ 2003-03-25 16:06 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, vencain
Synopsis: Empty structure initialization fails under C++ (but works under C)
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Tue Mar 25 15:53:44 2003
State-Changed-Why:
I can confirm this, with 3.3 and 3.4 as well. I think the
syntax you use is actually C99, so somebody in the know
should decide whether we also want to support it in C++.
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10207
^ permalink raw reply [flat|nested] 3+ messages in thread
* c++/10207: Empty structure initialization fails under C++ (but works under C)
@ 2003-03-25 8:36 vencain
0 siblings, 0 replies; 3+ messages in thread
From: vencain @ 2003-03-25 8:36 UTC (permalink / raw)
To: gcc-gnats
>Number: 10207
>Category: c++
>Synopsis: Empty structure initialization fails under C++ (but works under C)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Mar 25 08:26:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Marcus VenCain
>Release: gcc version 3.2 20020903
>Organization:
>Environment:
(Red Hat Linux 8.0 3.2-7)
>Description:
Compiling the provided code works under C while producing the following using either gcc or g++:
parse error before `}' token
excess elements in aggregate initializer
The provided code is derived from headers designed for C programs that I must include but am not responsible for maintaining.
>How-To-Repeat:
typedef struct { } EmptyStruct;
typedef struct {EmptyStruct Empty;} DemoStruct;
void Func(void)
{
DemoStruct Demo;
Demo.Empty = (EmptyStruct) {};
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-03-25 23:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-26 1:46 c++/10207: Empty structure initialization fails under C++ (but works under C) David R. Whipple
-- strict thread matches above, loose matches on Subject: below --
2003-03-25 16:06 bangerth
2003-03-25 8:36 vencain
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).