This is the mail archive of the
mailing list for the Cygwin project.
Re: Problems with GMP in latest Cygwin
- From: William Hart <hart_wb at yahoo dot com>
- To: cygwin at cygwin dot com
- Date: Sat, 7 Oct 2006 13:24:54 -0700 (PDT)
- Subject: Re: Problems with GMP in latest Cygwin
I reported earlier some problems with gmp_printf and
gmp_scanf when running GMP under Cygwin.
My program now runs correctly. I will vaguely discuss
some of the problems for the benefit of those who may
have had similar issues:
Firstly I was using Cygwin on a **64** bit Athlon,
running on **32** bit Windows XP.
I'm not sure about what choices of bit length are made
for long's under such circumstances, but one has to be
very careful of the following:
1) printf("%ld",longvar) expects a long
2) Using gmp_scanf and gmp_printf after instances of
ordinary printf and scanf when the incorrect
assumptions have been made about the length of a long
may cause problems (note the compiler may not give an
error or warning).
3) Replacing long's with u_int32_t's may further
compound the problems: GMP expects a ui (in functions
like mpz_mul_ui) to be 32 bits on a 32 bit machine and
64 bits on a 64 bit machine. But what does it expect
on a 64 bit machine running in 32 bit mode? One must
use a long, but this may cause issues elsewhere.
Some combination of the above led me to write a
program which compiled without warnings and which ran
correctly on my 32 bit laptop, but which compiled
correctly did not run correctly on my 64 bit Athlon
running 32 bit Windows XP (under Cygwin).
C is portable only if you are porting it to the same
kind of machine, using the same operating system with
the same kind of OS emulator!!
--- William Hart <firstname.lastname@example.org> wrote:
> I seem to be having some problems with the GMP
> in the latest version of Cygwin. I just installed
> latest Cygwin along with the latest GMP, however C
> code that previously worked with GMP+Cygwin no
> To try and determine whether this is a Cygwin
> or not, I recompiled the earlier version of GMP
> worked previously) on the latest version of Cygwin
> it doesn't fix the problem.
> The problems are strange. The gmp_printf and
> functions do not appear to work correctly (the
> not at all, the later does not wait for input).
> For some reason there is also an obscure error which
> causes programs to hang just before they finish. The
> console also does not respond to CTRL-C as it used
> I have checked that the my code works correctly with
> the old version of Cygwin + GMP (4.1.x).
> Another possibility is a conflict with the hardware
> am using. The new version of Cygwin is installed on
> Athlon 64 Dual Core 3800+ running Windows XP 32 bit
> version. The old version is installed on my Athlon
> 2000+ laptop.
> One possibility would be to try installing the old
> version of Cygwin on my new machine to see if the
> problem goes away. Is there a way of doing this?
> I do not want to install the new version of Cygwin
> my laptop as I am using it to do some development
> which must be completed by Oct 1st, thus I cannot
> screwing it up.
> Thanks in advance for any help.
> Unsubscribe info:
> Problem reports:
> Documentation: http://cygwin.com/docs.html
> FAQ: http://cygwin.com/faq/
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html