[PATCH] support for mingw-w64
Ozkan Sezer
sezeroz at gmail.com
Fri Sep 11 12:21:52 CEST 2009
On Fri, Sep 11, 2009 at 12:49 PM, Torbjorn Granlund <tg at gmplib.org> wrote:
> Ozkan Sezer <sezeroz at gmail.com> writes:
>
> On Fri, Sep 11, 2009 at 12:26 PM, Torbjorn Granlund <tg at gmplib.org> wrote:
> > Thanks for the GMP patch!
> >
> > Comments:
> >
> > * We unfortunately cannot use intptr_t unconditionally, since it is not
> > available everywhere we want GMP to work; it is a C99 feature.
> >
> > I wonder if size_t could be used instead? While perhaps not elegant,
> > it should work. Does anybody see any problem?
>
> Hmm, ssize_t would be a better choice, IMHO, for matched
> signedness, but ..
>
> Is ssize_t standard? Is signedness really depended upon? (And what is
> a signed pointer, anyway?)
>
> > (Alternatively, we could define our own little type, gmp_intptr_t
> > which we set up in gmp-impl.h. There are some precedents in that
> > file.)
>
> .. this would surely be a much better solution.
>
> Are you willing to implement and test it?
>
On Fri, Sep 11, 2009 at 12:57 PM, Niels Möller <nisse at lysator.liu.se> wrote:
> Torbjorn Granlund <tg at gmplib.org> writes:
>
>> * We unfortunately cannot use intptr_t unconditionally, since it is not
>> available everywhere we want GMP to work; it is a C99 feature.
>>
>> I wonder if size_t could be used instead? While perhaps not elegant,
>> it should work. Does anybody see any problem?
>
> Another alternative is ptrdiff_t. My understanding is that this is
> fairly portable in both theory and practice.
>
> /Niels
>
That's perfectly fine with us if it is agreed upon.
If not, I may find some time to try adding a
gmp_intptr_t
> > * Why is it necessarly to pass -std=c99 to gcc?
> >
> > Passing this flag to gcc might be a good idea for all configurations,
> > but then it should better be done using a global feature test, perhaps
> > via our _opt flags mechanism. Setting a globally avaiblable flags for
> > one platform seems wrong.
>
> Without c99 mode, gcc, rightfully, emits _a lot_ of warnings like:
> fib_table.c:12:1: warning: use of C99 long long integer constant
> .. which is because of long long.
> If you want to make it global for all targets, I have no problems
> with that at all.
>
> It does? I've used longlong loads of time and GCC has been silent like
> a lamb.
I can send you a camera shot of my screen if you want ;)
>
> > Did you write this patch yourself? It is large enough to be covered by
>
> Updated an old patch
>
> Written by whom?
>
It was an old patch against gmp-4.2.2 posted at the mingw-w64
site which no one remembers the original author any longer. I
can get responsibility for this one and can contact fsf for extending
my paperwork for gmp if the discussion is settled and if a form
of the patch is found acceptable.
> Torbjörn
>
--
Ozkan
More information about the gmp-devel
mailing list