cross-compile changes

5 views
Skip to first unread message

Brent Pedersen

unread,
Apr 24, 2015, 5:45:27 PM4/24/15
to biogo...@googlegroups.com
Hi Dan, I am trying to cross-compile a program that uses
biogo/hts/sam. Unchanged, I got lots of errors like:

--> windows/386 error: exit status 2
Stderr: # github.com/biogo/hts/sam
../../biogo/hts/sam/auxtags.go:75: constant 4294967295 overflows int
../../biogo/hts/sam/auxtags.go:150: constant 4294967295 overflows int

If I make the change below, the cross-compilation appears to go
smoothly. Would you accept a pull request for this?

thanks,
-Brent

diff --git a/sam/auxtags.go b/sam/auxtags.go
index b8d1cef..53f76ae 100644
--- a/sam/auxtags.go
+++ b/sam/auxtags.go
@@ -72,7 +72,7 @@ func NewAux(t Tag, typ byte, value interface{}) (Aux, error) {
a = Aux{t[0], t[1], 'I', 0, 0, 0, 0, 0}
binary.LittleEndian.PutUint32(a[4:8], uint32(i))
default:
- return nil, fmt.Errorf("sam: unsigned
integer value out of range %d > %d", i, math.MaxUint32)
+ return nil, fmt.Errorf("sam: unsigned
integer value out of range %d > %d", i, uint32(math.MaxU
}
return a, nil
case int8:
@@ -147,7 +147,7 @@ func NewAux(t Tag, typ byte, value interface{})
(Aux, error) {
return nil, fmt.Errorf("sam: wrong dynamic
type %T for 'B' tag", value)
}
l := rv.Len()
- if l > math.MaxUint32 {
+ if uint32(l) > uint32(math.MaxUint32) {
return nil, fmt.Errorf("sam: array too long
for 'B' tag")
}
a := Aux{t[0], t[1], 'B', 0, 0, 0, 0, 0}

Dan Kortschak

unread,
Apr 24, 2015, 6:57:38 PM4/24/15
to Brent Pedersen, biogo...@googlegroups.com
The general fix is to use uint. I'll do that later today.

Brent Pedersen

unread,
Apr 24, 2015, 8:24:53 PM4/24/15
to Dan Kortschak, biogo...@googlegroups.com

Cheers

Dan Kortschak

unread,
Apr 24, 2015, 8:54:21 PM4/24/15
to Brent Pedersen, biogo...@googlegroups.com
In your OP, you say lots. Is there more than the two you show there?
--
You received this message because you are subscribed to the Google Groups "biogo-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biogo-user+...@googlegroups.com.
To post to this group, send email to biogo...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brent Pedersen

unread,
Apr 24, 2015, 8:55:17 PM4/24/15
to Dan Kortschak, biogo...@googlegroups.com
No, just those 2, it appears a lot of times because it's
cross-compiles for a lot of OS+arch combos.

On Fri, Apr 24, 2015 at 6:53 PM, Dan Kortschak

Dan Kortschak

unread,
Apr 24, 2015, 9:00:24 PM4/24/15
to Brent Pedersen, biogo...@googlegroups.com
BTW I'll get to this in a few hours. If you want to make the changes using uint and send a PR (and a PR to biogo adding yourself to A+C) I'll accept it pending passing tests. Then you won't need to wait on me.

Dan Kortschak

unread,
Apr 24, 2015, 11:02:59 PM4/24/15
to Brent Pedersen, biogo...@googlegroups.com
Fix pushed. Please try.

Brent Pedersen

unread,
Apr 25, 2015, 9:31:19 AM4/25/15
to Dan Kortschak, biogo...@googlegroups.com
yes, that works. thanks so much.

On Fri, Apr 24, 2015 at 9:02 PM, Dan Kortschak
<dan.ko...@adelaide.edu.au> wrote:
> Fix pushed. Please try.
>
> --
> You received this message because you are subscribed to the Google Groups "biogo-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to biogo-user+...@googlegroups.com.
> To post to this group, send an email to biogo...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages