lua-users home
lua-l archive

Re: [ANN] Lua 5.3.0 (beta) now available

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> 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

AltStyle によって変換されたページ (->オリジナル) /