Re: [go-nuts] What's the maximum array length?

2022-10-27 Thread Kurtis Rader
On Thu, Oct 27, 2022 at 9:16 PM Rob Pike wrote: > For those watching at home, the error message is > > compile: data too large > Yes, but as I noted in my reply if you remove the composite literal initializer (i.e., reducing it to just var x = [1 << 34]byte{}) I get this error (using Go 1.19 on

Re: [go-nuts] What's the maximum array length?

2022-10-27 Thread Rob Pike
Ah, and here's why. cmd/internal/obj/objfile as a 32-bit data size. if int64(uint32(dataOff)) != dataOff { log.Fatalf("data too large") } On Fri, Oct 28, 2022 at 3:15 PM Rob Pike wrote: > For those watching at home, the error message is > > compile: data too large > > -rob > > > > On Fri,

Re: [go-nuts] What's the maximum array length?

2022-10-27 Thread Rob Pike
For those watching at home, the error message is compile: data too large -rob On Fri, Oct 28, 2022 at 12:43 PM eric...@arm.com wrote: > The spec says that " The length is part of the array's type; it must > evaluate to a non-negative constant >

[go-nuts] What's the maximum array length?

2022-10-27 Thread eric...@arm.com
The spec says that " The length is part of the array's type; it must evaluate to a non-negative constant representable by a value of type int. ", so on a 64-bit environment, I assume that the maximum array length