From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, WEIRD_PORT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1014db,9adfbb907494972e X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,9adfbb907494972e X-Google-Attributes: gid103376,public From: Tanmoy Bhattacharya Subject: Re: Ada to C/C++ translator needed Date: 1996/10/06 Message-ID: #1/1 X-Deja-AN: 187141070 references: <32499FA0.4B5E@magic.fr> <52feul$os2@goanna.cs.rmit.edu.au> organization: Los Alamos National Laboratory newsgroups: comp.lang.c,comp.lang.ada Date: 1996-10-06T00:00:00+00:00 List-Id: fred@genesis.demon.co.uk (Lawrence Kirby) writes: > >> static int i = 1 ? 1 : (++j); > >Fair enough, given an appropriate declaration for j, > >this line gets through > >Evidently, by your argument, I haven't _got_ any C compilers to test! One usually talks about any real shadow of a platonic ideals :-) > Possibly, but you haven't proved it. You have to consider 6.4: > > "An implementation may accept other forms of constant expression" Not quite. It is still not allowed to violate constraints (This came up in the discussion about `char a[1?1:(0,0)]' or some such meaningless example in comp.std.c). j++ in a constant expression is a violation of a constraint and must be diagnosed. The quoted phrase may be used to declare, for example, that a `const qualified non-volatile object initialized by a constant expression is a constant expression wherever the declaration initializng it is visible' (as a poster no doubt meant in a thread in c.l.c.m) in a particular implementation. Cheers Tanmoy -- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242) Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544 Others see , or. -- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]