RE: [go-nuts] Re: Slice conversion function not working on big endian platform

2024-05-08 Thread 'Pokala Srinivas' via golang-nuts
on big-endian machine but working on little endian . From: 'Pokala Srinivas' via golang-nuts Sent: 08 May 2024 15:39 To: golang-nuts ; Brian Candler Subject: [EXTERNAL] Re: [go-nuts] Re: Slice conversion function not working on big endian platform There is typo

Re: [go-nuts] Re: Slice conversion function not working on big endian platform

2024-05-08 Thread 'Pokala Srinivas' via golang-nuts
Subject: [EXTERNAL] [go-nuts] Re: Slice conversion function not working on big endian platform That code doesn't even compile in go 1. 22 or go. 1. 21: https: //go.  dev/play/p/mPCBUQizSVo ./prog. go: 20: 14: cannot convert unsafe. Pointer(s) (value of type unsafe. Pointer) to type []To What's the u

[go-nuts] Re: Slice conversion function not working on big endian platform

2024-05-08 Thread 'Brian Candler' via golang-nuts
That code doesn't even compile in go 1.22 or go.1.21: https://go.dev/play/p/mPCBUQizSVo ./prog.go:20:14: cannot convert unsafe.Pointer(s) (value of type unsafe.Pointer) to type []To What's the underlying requirement? In the test case it looks like you want to take a slice of int32's, in