This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: A little bit of C fun...
- From: John Carter <john dot carter at tait dot co dot nz>
- To: me22 <me22 dot ca at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 23 Oct 2008 11:35:11 +1300 (NZDT)
- Subject: Re: A little bit of C fun...
- References: <alpine.DEB.1.00.0810221735040.30487@parore.tait.co.nz><fa28b925 0810212203u51a1da18n13ae93aabde567a0@mail.gmail.com><alpine.DEB.1.00.081023 0830390.23033@parore.tait.co.nz><fa28b9250810221502k180db1f4j55d6f636ba200f 71@mail.gmail.com>
On Wed, 22 Oct 2008, me22 wrote:
On Wed, Oct 22, 2008 at 15:37, John Carter <john.carter@tait.co.nz> wrote:
On Wed, 22 Oct 2008, me22 wrote:
Use the preprocessor. Otherwise you can't get braces inside parens.
Nope. I didn't use preprocessor. But warped kudos to you for thinking
of it.
Say, what about -std=gnu++0x? Then the braces can be an initializer list...
I compiled this with gcc 3 and gcc 4 using -std=c89 and -std=c99 with
-Wall and -W.
gcc-2.95 failed
a(&(b){c})
but passed
a((b){c})
-W warns about a(&(b){}) but that is one of those cases where -W
warns about a potential omission in a legal operation.
And yes, you're on the right track now, the braces are an initializer list.
John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : john.carter@tait.co.nz
New Zealand