This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [Bug c++/12615] [3.3 Regression] initializer syntax for PADstructs gives parse error
- From: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- To: gdr at integrable-solutions dot net <gcc-bugzilla at gcc dot gnu dot org>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 14 Oct 2003 22:38:12 +0100 (BST)
- Subject: Re: [Bug c++/12615] [3.3 Regression] initializer syntax for PADstructs gives parse error
- References: <20031014193706.12615.bruno@clisp.org> <20031014195443.4776.qmail@sources.redhat.com>
On Tue, 14 Oct 2003, gdr at integrable-solutions dot net wrote:
> object vorg = (object) { one_o: 0, allocstamp: 0 };
>
> while valid C99, is invalid C++.
There are two extensions to C++ in play here:
* Compound literals (documented as supported as an extension in C++).
* Designated initializers, documented as unimplemented in GNU C++. This
example in fact uses the obsolete GNU syntax rather than the standard C99
one. I'd like to deprecate that obsolete syntax properly - the obstacle
to doing so is deployed glibc headers that use the obsolete syntax in
macros on the basis that (some version of) G++ does in fact support
designated initializers, but only with the old and not the C99 syntax!
--
Joseph S. Myers
jsm@polyomino.org.uk