lua-users home
lua-l archive

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


Matěj Cepl píše v Po 06. 07. 2020 v 18:58 +0200:
> Matěj Cepl píše v Čt 02. 07. 2020 v 18:47 +0200:
> > When trying to build Lua 5.4 for openSUSE (with running the test 
> > suite from https://www.lua.org/tests/) we hit one failing test 
> > (the full log is on https://is.gd/pFDvtp):

And one more:

on 32bit arch test checkDateTable(0x80000000) on line 794 of
files.lua overflows. I have added this:

@@ -784,6 +784,15 @@ local function checkDateTable (t)
   _G.D = nil
 end
 
+local function is64bit()
+  local arch = io.popen("uname -m"):read("*a")
+  if (arch or ""):match("64") then
+    return 64
+  else
+    return 32
+  end
+end
+
 checkDateTable(os.time())
 if not _port then
   -- assume that time_t can represent these values
@@ -791,7 +800,9 @@ if not _port then
   checkDateTable(1)
   checkDateTable(1000)
   checkDateTable(0x7fffffff)
-  checkDateTable(0x80000000)
+  if is64bit() == 64 then
+      checkDateTable(0x80000000)
+  end
 end
 
 checkerr("invalid conversion specifier", os.date, "%")

And now finally whole test suite passes on all openSUSE-supported 
platforms.

Best,

Matěj

-- 
https://matej.ceplovi.cz/blog/, Jabber: mcepl@ceplovi.cz
GPG Finger: 3C76 A027 CA45 AD70 98B5  BC1D 7920 5802 880B C9D8
 
If trains stop at train stations, what happens at work stations?

Attachment: signature.asc
Description: This is a digitally signed message part