From: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Subject: Re: CXX Compiler Barfs on traditional C cast
Date: 16 Aug 2003 00:56:19 +0200 [thread overview]
Message-ID: <87wudebkdo.fsf@student.uni-tuebingen.de> (raw)
In-Reply-To: 4ae5eb22.0308151453.45feb80@posting.google.com
w.f.alexander@attbi.com (Bill Alexander) writes:
> #define FOOBLD(x,y,z) ((foo){(x),(y),(z)})
>
> The .c version works perfectly and as I'd expect in traditional C.
> The .cc version has a compiler failure with something like:
> "error: expected expression" where the macro with the cast shows up.
This is not a "traditional cast". It's a compound literal. This was
only introduced in C99, whereas C++ is based on C89. Therefore, the
C++ compiler is correct in rejecting it.
--
Falk
next prev parent reply other threads:[~2003-08-15 22:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-15 22:53 CXX Compiler Barfs on traditional C cast Bill Alexander
2003-08-15 22:56 ` Falk Hueffner [this message]
2003-08-18 17:04 ` Bill Alexander
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox