Version 4.1.4: gmp_printf() fails.

Henrik Johansson mhrkjohansson at
Tue Jan 31 15:39:44 CET 2006

The following program fails with a "Segmentation fault" when compiled
and run on both a cygwin and a debian system.
#include <stdio.h>
#include <gmp.h>

main(int argc, char *argv[])
  mpz_t res;

  mpz_init_set_ui(res, 1);
  mpz_mul_2exp(res, res, 30402457);
  mpz_sub_ui(res, res, 1);
  gmp_printf("%Zd", res);

  return 0;


Henrik Johansson, +46(707)364599

More information about the gmp-bugs mailing list