Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!quintus!ok From: ok@quintus.uucp (Richard A. O'Keefe) Newsgroups: comp.lang.fortran Subject: Re: Fortran vs C for computations Message-ID: <367@quintus.UUCP> Date: 8 Sep 88 09:57:04 GMT References: <962@amelia.nas.nasa.gov> <3290@lanl.gov> Sender: news@quintus.UUCP Reply-To: ok@quintus.UUCP (Richard A. O'Keefe) Organization: Quintus Computer Systems, Inc. Lines: 19 In article <3290@lanl.gov> jlg@lanl.gov (Jim Giles) writes: >#ifdef is an admission that your compiler isn't any good. If the >conditional expression is a constant, a normal if statement should >be optimized so that code is only generated for the active branch. If >the conditional expression is not a constant, it couldn't be used as >part of an #ifdef either. Spot the hidden assumption? Right: #ifdef is used more often to select which header files to #include, which of several sets of declarations to use, and so on. For example, how would optimisation of IF statements help someone who wants the functional equivalent of #if REAL_IS_ENOUGH REAL FRED, THOM #else DOUBLE PRECISION FRED, THOM #endif (Yes, I know about Fortran 8x parametrised types. That's not the question.)