From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,8a2df0e0ea806c7f,start X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2003-08-15 15:53:28 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: w.f.alexander@attbi.com (Bill Alexander) Newsgroups: comp.unix.tru64 Subject: CXX Compiler Barfs on traditional C cast Date: 15 Aug 2003 15:53:27 -0700 Organization: http://groups.google.com/ Message-ID: <4ae5eb22.0308151453.45feb80@posting.google.com> NNTP-Posting-Host: 208.19.29.104 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1060988008 745 127.0.0.1 (15 Aug 2003 22:53:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 15 Aug 2003 22:53:28 GMT Xref: archiver1.google.com comp.unix.tru64:10702 Imagine I have the following code: #include typedef struct { int a ; int b; int c; } foo; #define FOOBLD(x,y,z) ((foo){(x),(y),(z)}) int main(void) { foo bar; bar = FOOBLD(1,2,3); printf("%d %d %d\n", bar.a, bar.b, bar.c); return 0; } Say I save the file under two names: test.c and test.cc. Under Tru64 5.0A with CXX (whatever the stock revision is), I compile both files with: cxx test.c cxx test.cc 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. I can't reproduce this with other OS's compilers, and don't see any other references on the 'net to this problem. I need to get something like this working in order to remain compatible with a large body of legacy code. Does anyone have an idea about what I'm missing here? Thanks in advance. - Bill