From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,318ffa5ce8258c67 X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-02-25 20:17:52 PST Path: gmd.de!newsserver.jvnc.net!netnews.upenn.edu!dsinc!ub!news.kei.com!yeshua.marcam.com!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!vixen.cso.uiuc.edu!sdd.hp.com!decwrl!pa.dec.com!decuac.dec.com!dco.dec.com!murphy From: murphy@dco.dec.com (Rick Murphy) Newsgroups: comp.unix.osf.osf1 Subject: Re: OSF/1 1.3 cc -O Bug! Date: 22 Feb 1994 19:19:33 GMT Organization: Digital Equipment Corporation, Greenbelt MD Sender: murphy@rhmosf.dco.dec.com (Rick Murphy) Distribution: world Message-ID: <2kdls5$ief@decuac.dec.com> References: <2kbb1p$630@paperboy.gsfc.nasa.gov> Reply-To: murphy@dco.dec.com NNTP-Posting-Host: rhmosf.dco.dec.com X-Newsreader: mxrn 6.18-10 In article , gwesp@wst.edvz.sbg.ac.at (Wesp Gerhard) writes: >First of all, please note that that piece of code may even have >an application: If int and double have the same storage size, >this should just 'typecast' the argument x to an int, yielding the internal >representation of the double. You could then use the int to extract >the fields of the double (sign, mantissa, exponent). It's not that easy (but that's the compiler's problem..) the floating argument is passed in a floating point register and needs to be stored/loaded in order to be converted to integer. > I don't know if the bug (YES, this is a *BUG*) resides in the OS or the >compiler, but I hope the people at DEC (who are reading this, right?) will >*IMMEDIATELY* find that out and fix it. Anytime the compiler crashes it's a bug. Fortunately, this is fixed in 2.0: % uname -a OSF1 rhmosf.dco.dec.com X2.0 201.1 alpha % cat crash.c int i(double x) { int *p; p= &x; return *p; } % cc -O crash.c /usr/lib/cmplrs/cc/cfe: Warning: crash.c, line 4: Incompatible pointer type assi gnment p= &x; ---^ ld: Unresolved: main -- Rick Murphy, WA1SPT/4 Washington Federal Programs Office Domain: murphy@dco.dec.com Technical Support Group Bang: decwrl!burfle.enet!murphy This posting expresses MY opinions only; Ding: 301-306-2040. I do not speak for Digital.