Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 May 2002 12:13:37 -0700
From:      Alfred Perlstein <bright@mu.org>
To:        Chris Hedley <cbh@teabag.demon.co.uk>
Cc:        Mike Barcroft <mike@freebsd.org>, freebsd-current@freebsd.org
Subject:   Re: strtod & sscanf on -CURRENT?
Message-ID:  <20020524191337.GK54960@elvis.mu.org>
In-Reply-To: <20020524184214.M3863-100000@teabag.cbhnet>
References:  <20020524131550.C26122@espresso.q9media.com> <20020524184214.M3863-100000@teabag.cbhnet>

next in thread | previous in thread | raw e-mail | index | archive | help
* Chris Hedley <cbh@teabag.demon.co.uk> [020524 10:53] wrote:
> On Fri, 24 May 2002, Mike Barcroft wrote:
> > Would it be possible for you to reproduce the source to a small
> > program that demonstrates the problem?
> 
> Okay, here's a cheap'n'nasty program to demonstrate the problem; the
> revised problem seems to be that strtod() is okay with integers but if a
> period is present in the value passed to it, it returns the count of the
> digits after the period, rather oddly:

You forgot to include stdlib.h.

Please compile things with -Wall before reporting "weirdness" on
the lists.

~ % gcc -Wall t.c
t.c:4: warning: return type defaults to `int'
t.c: In function `main':
t.c:10: warning: implicit declaration of function `tolower'
t.c:10: warning: implicit declaration of function `exit'
t.c:11: warning: implicit declaration of function `strchr'
t.c:11: warning: suggest parentheses around assignment used as truth value
t.c:13: warning: implicit declaration of function `strtod'


That's from the code you posted, scary what can happen and how much
of waste of your and our time this was. :)

-- 
-Alfred Perlstein [alfred@freebsd.org]
'Instead of asking why a piece of software is using "1970s technology,"
 start asking why software is ignoring 30 years of accumulated wisdom.'
Tax deductible donations for FreeBSD: http://www.freebsdfoundation.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020524191337.GK54960>