[v3] Fix ext/random/hypergeometric_distribution/operators/values.cc on Solaris 9

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Wed Nov 27 14:16:00 GMT 2013


ext/random/hypergeometric_distribution/operators/values.cc fails to
compile on Solaris 9 which lacks full C99 support in libc/libm:

FAIL: ext/random/hypergeometric_distribution/operators/values.cc (test for excess errors)

Excess errors:
/vol/gcc/src/hg/trunk/local/libstdc++-v3/testsuite/ext/random/hypergeometric_dis
tribution/operators/values.cc:41:45: error: 'hypergeometric_pdf' was not declare
d in this scope
/vol/gcc/src/hg/trunk/local/libstdc++-v3/testsuite/ext/random/hypergeometric_dis
tribution/operators/values.cc:46:48: error: 'hypergeometric_pdf' was not declare
d in this scope
/vol/gcc/src/hg/trunk/local/libstdc++-v3/testsuite/ext/random/hypergeometric_dis
tribution/operators/values.cc:51:47: error: 'hypergeometric_pdf' was not declare
d in this scope
/vol/gcc/src/hg/trunk/local/libstdc++-v3/testsuite/util/testsuite_random.h:56:7:
 error: void value not ignored as it ought to be
/vol/gcc/src/hg/trunk/local/libstdc++-v3/testsuite/util/testsuite_random.h:56:7:
 error: void value not ignored as it ought to be
/vol/gcc/src/hg/trunk/local/libstdc++-v3/testsuite/util/testsuite_random.h:56:7:
 error: void value not ignored as it ought to be

WARNING: ext/random/hypergeometric_distribution/operators/values.cc compilation failed to produce executable


hypergeometric_pdf is defined in testsuite/util/testsuite_random.h
inside _GLIBCXX_USE_C99_MATH_TR1, but used unconditionally.  Fixed which
the following patch which allows the test to compile and pass on
i386-pc-solaris2.9.  On i386-pc-solaris2.11, it FAILs with an Arithmetic
exception, as it did before the patch:

Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread 1 (LWP 1)]
0x080542ba in std::generate_canonical<unsigned int, 32u, std::mersenne_twister_engine<unsigned int, 32u, 624u, 397u, 31u, 2567483615u, 11u, 4294967295u, 7u, 2636928640u, 15u, 4022730752u, 18u, 1812433253u> > (__urng=...)
    at /var/gcc/regression/trunk/11-gcc/build/i386-pc-solaris2.11/libstdc++-v3/include/bits/random.tcc:3480
3480          return __sum / __tmp;

__tmp is 0 here.

Ok for mainline?

	Rainer


2013-11-27  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* testsuite/ext/random/hypergeometric_distribution/operators/values.cc
	(test01): Wrap in _GLIBCXX_USE_C99_MATH_TR1.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: v3.patch
Type: text/x-patch
Size: 648 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20131127/db153ebe/attachment.bin>
-------------- next part --------------

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


More information about the Libstdc++ mailing list