From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,8a2df0e0ea806c7f X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2003-08-15 15:58:12 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!feed.news.nacamar.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: Falk Hueffner Newsgroups: comp.unix.tru64 Subject: Re: CXX Compiler Barfs on traditional C cast Date: 16 Aug 2003 00:56:19 +0200 Organization: T-Online Sender: falk@juist Message-ID: <87wudebkdo.fsf@student.uni-tuebingen.de> References: <4ae5eb22.0308151453.45feb80@posting.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.t-online.com 1060988179 06 8443 XoSdV7bTSeY7aN 030815 22:56:19 X-Complaints-To: usenet-abuse@t-online.de X-ID: SPAL0UZJrebw7HkdA7RO8oT0J8-r8NErDu8tPAJWlNCZ-v0Pl1-cQD X-Face: "iUeUu$b*W_"w?tV83Y3*r:`rh&dRv}$YnZ3,LVeCZSYVuf[Gpo*5%_=/\_!gc_,SS}[~xZ wY77I-M)xHIx:2f56g%/`SOw"Dx%4Xq0&f\Tj~>|QR|vGlU}TBYhiG(K:2 #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