Command syntax problem
Charles Hewson
cahewson at eskimo.com
Sat Sep 25 02:55:30 CEST 2004
On Fri, 24 Sep 2004, David Relson wrote:
> On Fri, 24 Sep 2004 14:09:07 -0700 (PDT)
> Charles Hewson wrote:
>
> ...[snip]...
>
> > [cahewson] ./Bogofilter-new/bin/bogofilter -C -D -v -M -o0.45,0.4 -Q
> > sc 0.0000, hc 0.0000
> > val 1197288.0000
> > val 1197293.0000
> > sc 1197288.0000, hc 1197293.0000
> > # bogofilter version 0.92.6
>
> Looks like a problem with strtod(). The simplest explanation is that
> SunOS defines it in a different header file than does Linux and that the
> compiler doesn't know strtod() returns a double. This would then cause
> a conversion error in xatof.c
>
>
> As a first test, add the following line:
>
> extern double strtod (char *, char **);
>
> to xatof.c and return the "-Q" test.
>
> As a second test, run this command:
>
> grep -r -w strtod /usr/include/
>
> to find out which header file defines the function.
>
> HTH,
>
> David
> _______________________________________________
> Bogofilter mailing list
> Bogofilter at bogofilter.org
> http://www.bogofilter.org/mailman/listinfo/bogofilter
>
The extern statement seems to have worked;
/** \file xatof.c
* Implements xatof, an easy to use strtod() wrapper.
*
* \author Matthias Andree
* \date 2003
*/
#include "xatox.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
extern double strtod (char *, char **);
...
[cahewson] ./Bogofilter-new/bin/bogofilter -C -D -v -M -o0.45,0.4 -Q
sc 0.0000, hc 0.0000
val 0.4500
val 0.4000
sc 0.4500, hc 0.4000
# bogofilter version 0.92.6
Grep doesn't like -r on SunOS;
[cahewson] grep -r -w strtod /usr/include/
grep: illegal option -- r
usage: grep [-[[AB] ]<num>] [-[CEFGVchilnqsvwx]] [-[ef]] <expr>
[<files...>]
Thanks
Charles
More information about the Bogofilter
mailing list