[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Strange error with 5.4 random generator on old compiler
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 2 Dec 2022 09:36:23 -0300
> I recently did a build of 5.4.4 myself on a system with egcs-1.1.2 and
> found I had to do a bit of bludgeoning here and there; the similar line
> some ten lines later (with LUA_MAXUNSIGNED) was one of them. In my
> case, well, here's the result of my bludgeoning:
>
> /*
> * I've been unable to figure out how to avoid getting
> * "lmathlib.c", line 280: warning: integer constant out of range
> * for this on 1.4T. So, ugly as it is, we hardwire the knowledge
> * that all systems this patch tree will be used on have 64-bit
> * integers.
> */
> /* #elif (LUA_MAXUNSIGNED >> 31 >> 31) >= 3 */
> #elif 1
I assume you are using the standard configuration, with lua integer
defined as long long. Does your machine has 64-bit longs? If so, can
you try compiling Lua with lua integer defined as long, instead of
long long?
-------------------------------------------------
--- a/luaconf.h
+++ b/luaconf.h
@@ -109,7 +109,7 @@
/* Default configuration ('long long' and 'double', for 64-bit Lua) */
-#define LUA_INT_DEFAULT LUA_INT_LONGLONG
+#define LUA_INT_DEFAULT LUA_INT_LONG
#define LUA_FLOAT_DEFAULT LUA_FLOAT_DOUBLE
-------------------------------------------------
> (I'm actually not sure whether it would have compiled the correct code
> anyway; I use -Werror, and considered the above patch preferable to
> dropping -Werror. I can share the rest of my patches too if anyone is
> interested.)
I am :-)
-- Roberto