Very basic bug

Álvaro Begué alvaro.begue at
Wed Nov 29 01:18:04 CET 2006

GMP version: 4.2.1

Sample program:

#include <iostream>
#include <gmpxx.h>

int main(){
  mpz_class a=1,b=1,c=0;
  std::cout << a << std::endl; //Should print 1, but prints 0

The only configuration option I used when building the library was --enable-cxx

Output of `gcc -v':

Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --enable-checking=release
Thread model: posix
gcc version 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)

Output of `uname -a':

Linux downstairs 2.6.17-10-generic #2 SMP Fri Oct 13 15:34:39 UTC 2006
x86_64 GNU/Linux

`./config.guess' and `./configfsf.guess' both output:


I compiled it with:

g++ bug.cpp -o bug -O6 -lgmpxx -lgmp -static

Let me know if you need anything else.


More information about the gmp-bugs mailing list