Skip Menu |

This queue is for tickets about the Math-Int128 CPAN distribution.

Report information
The Basics
Id: 89304
Status: open
Priority: 0/
Queue: Math-Int128

People
Owner: Nobody in particular
Requestors: DROLSKY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: perl_math_int128.h does not compile
I had to copy the typdefs for int128_t and uint128_t from the accompanying perl_math_int128.c to get the header to compile, which makes sense.
Subject: Re: [rt.cpan.org #89304] perl_math_int128.h does not compile
Date: Tue, 8 Oct 2013 01:11:22 -0700 (PDT)
To: "bug-Math-Int128 [...] rt.cpan.org" <bug-Math-Int128 [...] rt.cpan.org>
From: Salvador Fandino <sfandino [...] yahoo.com>
Show quoted text
>________________________________ > From: Dave Rolsky via RT <bug-Math-Int128@rt.cpan.org> >To: >Sent: Monday, October 7, 2013 7:06 PM >Subject: [rt.cpan.org #89304] perl_math_int128.h does not compile > > >Mon Oct 07 13:06:58 2013: Request 89304 was acted upon. >Transaction: Ticket created by DROLSKY >       Queue: Math-Int128 >     Subject: perl_math_int128.h does not compile >   Broken in: (no value) >    Severity: (no value) >       Owner: Nobody >  Requestors: DROLSKY@cpan.org >      Status: new >Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=89304 > > > >I had to copy the typdefs for int128_t and uint128_t from the accompanying perl_math_int128.c to get the header to compile, which makes sense.
That's on purpose, to avoid collisions with other code also defining them, which is a pretty common thing. Though, I suppose it should be better documented.
CC: DROLSKY [...] cpan.org
Subject: Re: [rt.cpan.org #89304] perl_math_int128.h does not compile
Date: Tue, 8 Oct 2013 14:22:40 +0000 (UTC)
To: "Salvador \\"Fandiño\\" via RT" <bug-Math-Int128 [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Tue, 8 Oct 2013, Salvador \"Fandiño\" via RT wrote: Show quoted text
>> I had to copy the typdefs for int128_t and uint128_t from the accompanying perl_math_int128.c to get the header to compile, which makes sense.
> > > That's on purpose, to avoid collisions with other code also defining them, which is a pretty common thing. > > Though, I suppose it should be better documented.
It's just not clear how one is expected to use this then. Are we supposed to define them in our own code before including this header? The header relies on these definitions, so they have to be present somehow. -dave /*============================================================ http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) ============================================================*/
Subject: Re: [rt.cpan.org #89304] perl_math_int128.h does not compile
Date: Tue, 8 Oct 2013 22:44:13 -0700 (PDT)
To: "bug-Math-Int128 [...] rt.cpan.org" <bug-Math-Int128 [...] rt.cpan.org>
From: Salvador Fandino <sfandino [...] yahoo.com>
Show quoted text
----- Original Message -----
> From: "autarch@urth.org via RT" <bug-Math-Int128@rt.cpan.org> > To: > Cc: > Sent: Tuesday, October 8, 2013 4:22 PM > Subject: Re: [rt.cpan.org #89304] perl_math_int128.h does not compile > >       Queue: Math-Int128 > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=89304 > > > On Tue, 8 Oct 2013, Salvador \"Fandiño\" via RT wrote: >
>>> I had to copy the typdefs for int128_t and uint128_t from the
> accompanying perl_math_int128.c to get the header to compile, which makes sense.
>> >> >> That's on purpose, to avoid collisions with other code also defining
> them, which is a pretty common thing.
>> >> Though, I suppose it should be better documented.
> > It's just not clear how one is expected to use this then. Are we supposed > to define them in our own code before including this header?
Yes, the reason behind is that if you are wrapping some library (say libfoo) that uses 128 bit integers, those types are probably already defined on the library header (libfoo.h), and so, defining them again in perl_math_int128.h will cause an error.
CC: DROLSKY [...] cpan.org
Subject: Re: [rt.cpan.org #89304] perl_math_int128.h does not compile
Date: Wed, 9 Oct 2013 15:05:38 +0000 (UTC)
To: "Salvador \\"Fandiño\\" via RT" <bug-Math-Int128 [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Wed, 9 Oct 2013, Salvador \"Fandiño\" via RT wrote: Show quoted text
>> It's just not clear how one is expected to use this then. Are we supposed >> to define them in our own code before including this header?
> > Yes, the reason behind is that if you are wrapping some library (say libfoo) that uses 128 bit integers, those types are probably already defined on the library header (libfoo.h), and so, defining them again in perl_math_int128.h will cause an error.
If someone else has a typedef for uint128_t that doesn't match the header's typedef then this will break anyway. I think it's better to just define the typedef and then if there's a conflict the compiler should report an error (right?). -dave /*============================================================ http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) ============================================================*/