Problem (with fix) concerning GMP's C++ random number class

Roberto Bagnara bagnara@cs.unipr.it
Thu, 07 Nov 2002 07:25:50 +0100


Kevin Ryde wrote:
> Roberto Bagnara <bagnara@cs.unipr.it> writes:
> 
>>a strictly conforming C++ compiler,
> 
> 
> For instance?  g++ 3.2 -pedantic has no objections to the current
> code.

For instance Comeau C++ compiler with option --strict and (IIRC,
but I don't have it handy at the moment) Intel's icc compiler
with the -Xc option (select strict ANSI C/C++ conformance dialect).
However, the point is that the code I have indicated violates the
standard;  as C++ compiler are moving more and more towards standard
conformance the problem may show up at any time with any compiler.

>>+ extern "C" typedef void GMP_RANDINIT_DEFAULT(gmp_randstate_t);
> 
> 
> Can this be private to gmp_randclass, or given within the definitions
> of the constructors?  If not then they'll want to be prefixed like
> __gmp_randinit_default_t, or some such.

You are right of course (indeed I was expecting Gerardo, as the father,
of the C++ interface, would elaborate on the idea so as to suit his taste).
I will provide a better patch at the soonest (since I really hope it could
be incorporated in the next GMP's release).
All the best

     Roberto

-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara@cs.unipr.it