Compile error V0.91.1: gsl_sf_exp_e redefined

David Relson relson at osagesoftware.com
Wed Jun 9 21:20:20 CEST 2004


On Wed, 9 Jun 2004 20:53:51 +0200
Matthias Andree wrote:

> On Wed, 09 Jun 2004, Uwe Richter wrote:
> 
> > while making bogofilter-0.91.1 with successfully built
> > db-4.2.52 under Tru64-UNIX with it's native (non GNU) cc I get a
> > 
> > cc: Error: ../gsl/specfunc/exp.c, line 108: This declaration
> > contains a redefinition of "gsl_sf_exp_e".  The previous declaration
> > is at line number 45 in file ../gsl/gsl_sf_exp.h. (redef)
> > int gsl_sf_exp_e(const double x, gsl_sf_result * result)
> > ----^
> 
> "Interesting."
> 
> declaration from gsl_sf_exp.h (l. 45):
> int gsl_sf_exp_e(const double x, gsl_sf_result * result);
> 
> definition in specfunc/exp.c (l. 108):
> int gsl_sf_exp_e(const double x, gsl_sf_result * result)
> 
> These are identical, and hence are allowed.
> 
> This doesn't look right. Please try installing GCC and compiling with
> GCC instead of cc.

Interesting, indeed.  I took a look at the preprocessor output using

    gcc -E -I . ../gsl/specfunc/exp.c > exp.i
    grep -n -w gsl_sf_exp_e exp.i

and found the following:

2030:int gsl_sf_exp_e(const double x, gsl_sf_result * result);
2117:int gsl_sf_exp_e(const double x, gsl_sf_result * result)
2220:int gsl_sf_exp_e(const double x, gsl_sf_result * result)
2547:    return gsl_sf_exp_e(x, result);
2697:  gsl_sf_result result; int status = gsl_sf_exp_e(x, &result); if
(status != GSL_SUCCESS) { do { gsl_error ("gsl_sf_exp_e(x, &result)",
"../gsl/specfunc/exp.c", 584, status) ; return result.val ; } while (0);
} ; return result.val;;

Line 2030 is the prototype in exp.c
Line 2117 is part of an extern inline definition, i.e.

   extern inline
   int gsl_sf_exp_e(const double x, gsl_sf_result * result)

Line 2220 is the function definition and body from exp.c

Having _3_ definitions makes me thing the compiler may be right to
complain.  At least it's not a totally bogus message.



More information about the Bogofilter mailing list