From owner-freebsd-current Sat Mar 30 18:55:39 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id SAA06425 for current-outgoing; Sat, 30 Mar 1996 18:55:39 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id SAA06418 for ; Sat, 30 Mar 1996 18:55:34 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id MAA06978; Sun, 31 Mar 1996 12:52:19 +1000 Date: Sun, 31 Mar 1996 12:52:19 +1000 From: Bruce Evans Message-Id: <199603310252.MAA06978@godzilla.zeta.org.au> To: current@FreeBSD.org, regnauld@tetard.frmug.fr.net Subject: Re: Weird atof() behavior Sender: owner-current@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk > A friend of mine has had some problems with Rayshade running on > 2.0.5 (GCC 2.6.3) -- it appeared that atof() systematically > returned bogus values in certain conditions: if you omit to specify > #include , gcc does NOT issue any sort of warning for > atof(). Example: > #include > main() > { > foo* char="3.1415926"; > float bar=atof(foo); > printf("%f\n",bar); > } >... > The warning does show up with -Wall: > > atof.c:5: warning: implicit declaration of function `atof' This looks like a warning to me. The behaviour is undefined because atof is implicitly declared as returning `int' but actually returns `double'. Bruce