[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.3.0 (beta) now available
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sun, 26 Oct 2014 13:18:50 -0200
> The test for endianness seems brittle to me: it assumes that a short is
> two bytes long, which is common, but not guaranteed by C standard,
> as the following assertion also aknowledge (IIUC).
>
> In particular, if a short is 1 byte pack("h",1) will return "\1" on both
> big endian and little endian machines.
>
> Is that a bug in the test suite or just a conscious tradeoff to avoid
> more complex testing on exotic platforms?
There is no need for a more complex testing. It could (should) be
local little = (pack("i2", 1) == "\1\0")
Thanks for the report.
-- Roberto