From owner-freebsd-questions Fri Mar 19 4:35:10 1999 Delivered-To: freebsd-questions@freebsd.org Received: from mailout05.btx.dtag.de (mailout05.btx.dtag.de [194.25.2.153]) by hub.freebsd.org (Postfix) with SMTP id 435231551D for ; Fri, 19 Mar 1999 04:35:05 -0800 (PST) (envelope-from spinner.rflab@t-online.de) Received: from fwd04.btx.dtag.de (fwd04.btx.dtag.de [194.25.2.164]) by mailout05.btx.dtag.de with smtp id 10NyQl-0008VC-00; Fri, 19 Mar 1999 13:31:15 +0100 Received: from www (089126010-0002(btxid)@[62.156.3.104]) by fwd04.btx.dtag.de with smtp id ; Fri, 19 Mar 1999 13:30:57 +0100 Message-ID: <36F24371.37ACAF58@t-online.de> Date: Fri, 19 Mar 1999 12:30:41 +0000 X-Mailer: Mozilla 3.01Gold (X11; I; Linux 2.0.34 i586) MIME-Version: 1.0 To: freebsd-questions@FreeBSD.ORG Subject: Re: gnu C compiler References: <36EFA9ED.5126E95C@t-online.de> <19990317210724.9018.qmail@alpha.comkey.com.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Sender: 089126010-0002@t-online.de From: spinner.rflab@t-online.de (Steffen Hein) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Steffen Hein wrote: > > > How can you explain me that the same gnu C compiler ( release 2.7.2.1 ) > > in FreeBSD apparently does not handle the long double format correctly > > while in Linux it does ? Greg Black wrote: > > Learn to use gcc's warnings (at the very least -Wall), and > you'll see where your code is incorrect. > printf( "\n LDBL_MIN = % Le ", LDBL_MIN ); > > This is wrong, as gcc would have told you with -Wall: you are > passing a `double' to printf() but telling it you are passing a > `long double'. If you lie to the compiler, then it will get its > revenge. > > If you cast LDBL_MIN and friends to the correct type, then your > program will run to completion. > > -- > Greg Black The comment merely states that the gnu C compiler does not comply here with the ANSI standard, according to which the format instructions are legitimate. ( Cf. chapter 'The ANSI Runtime Library' in Darnell & Margolis, ISBN 0-387-97389-3, p.453, Springer ) - At any rate, Linux cooperates correctly. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message