Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: comp.lang.c Subject: Re: constant expression rules Message-ID: <8673@utzoo.UUCP> Date: Mon, 28-Sep-87 22:01:46 EDT Article-I.D.: utzoo.8673 Posted: Mon Sep 28 22:01:46 1987 Date-Received: Mon, 28-Sep-87 22:01:46 EDT References: <3018@ulysses.homer.nj.att.com> Organization: U of Toronto Zoology Lines: 16 Keywords: portability > The question is - what is a reasonable level of constant folding that > I can assume when trying to write portable code? ... Well, read X3J11's latest draft for what you *ought* to be able to assume. Now, in reality: 1. Keep It Simple. Keep It Simple. Keep It Simple. 2. Casts were a late addition to the language and to some compilers; expect trouble there. 3. Compile-time floating-point evaluation is another dangerous area, especially in cross-compilers. -- "There's a lot more to do in space | Henry Spencer @ U of Toronto Zoology than sending people to Mars." --Bova | {allegra,ihnp4,decvax,utai}!utzoo!henry