[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Missing feature in 5.3: LUA_FLOAT_NONE for crippled C libraries
- From: Real Time Logic <realtimelogic@...>
- Date: Tue, 20 Oct 2015 11:32:37 -0700
It would be more useful if you give concrete data, instead of generic
claims. Which/where floating point functions are used in the code? Which
constants? Why they are difficult to be corrected through the
configuration file?
I have included the complete error log below. The errors I get are
related to standard float functions such as floor, freexp, etc. I see
you wrap all of these calls in macro l_mathop, but I do not see how I
can cirumvent the use of the floating point library calls by modifying
l_mathop (i.e. by only modifying the config file). You can also see from
the log below the errors I get on math contants such as HUGE_VAL,
DBL_MANT_DIG, etc..
Of course, the best solution for you is to get your specific needs
fulfilled (that seems to be an univeral truth). The best solution for us
may involve some other metric.
-- Roberto
Yes, I do understand Roberto, but I would think a "non float" option
would be very common feature that fits many Lua use cases.
-Wilfred
The errors:
(Note: the missing prototype errors are not from not including the
correct header file. The functions simply do not exist in the C library).
### mwccmcf Compiler:
# File: R:\src\plugins\lua\lobject.c
# -------------------------------------
# 112: case LUA_OPPOW: return ((void)L, l_mathop(pow)( v1, v2));
# Error: ^
# function has no prototype
### mwccmcf Compiler:
# 113: (l_mathop(floor)((( v1)/( v2))))
# Error: ^
# function has no prototype
### mwccmcf Compiler:
# 117: { ( m) = l_mathop(fmod)( v1, v2); if (( m)*( v2) < 0)
( m) += ( v2); };
# Error: ^
# function has no prototype
### mwccmcf Compiler:
# 241: return l_mathop(ldexp)(r, e);
# Error: ^^^^^^^^
# function has no prototype
### mwccmcf Compiler:
# 255: *result = strtod((s), ( &endptr));
# Error: ^
# function has no prototype
### mwccmcf Compiler:
# File: R:\src\plugins\lua\lstrlib.c
# -------------------------------------
# 826: lua_Number dd = l_mathop(floor)(x); /* get integer part
from 'x' */
# Error: ^^^^^^^^
# function has no prototype
### mwccmcf Compiler:
# 834: if (x != x || x == HUGE_VAL || x == -HUGE_VAL) /* inf or
NaN? */
# Error: ^^^^^^^^
# undefined identifier 'HUGE_VAL'
### mwccmcf Compiler:
# 843: lua_Number m = l_mathop(frexp)(x, &e); /* 'x' fraction
and exponent */
# Error: ^^^^^^^^
# function has no prototype
### mwccmcf Compiler:
# 850: (DBL_MANT_DIG)
# Error: ^
# undefined identifier 'DBL_MANT_DIG'
### mwccmcf Compiler:
# 851: (DBL_MANT_DIG)
# Error: ^
# undefined identifier 'DBL_MANT_DIG'
### mwccmcf Compiler:
# 971: (DBL_MAX_10_EXP)
# Error: ^
# undefined identifier 'DBL_MAX_10_EXP'
Errors caused tool to abort.
### mwccmcf Compiler:
# File: R:\src\plugins\lua\ltable.c
# ------------------------------------
# 102: n = l_mathop(frexp)(n, &i) * -cast_num(INT_MIN);
# Error: ^^^^^^^^
# function has no prototype
### mwccmcf Compiler:
# File: R:\src\plugins\lua\lvm.c
# ---------------------------------
# 99: lua_Number f = (l_mathop(floor)(n));
# Error: ^
# function has no prototype
### mwccmcf Compiler:
# 270: (DBL_MANT_DIG)
# Error: ^
# undefined identifier 'DBL_MANT_DIG'
### mwccmcf Compiler:
# 289: (DBL_MANT_DIG)
# Error: ^
# undefined identifier 'DBL_MANT_DIG'
### mwccmcf Compiler:
# 951: { ( m) = l_mathop(fmod)( nb, nc); if (( m)*( nc) <
0) ( m) += ( nc); };
# Error: ^
# function has no prototype
### mwccmcf Compiler:
# 966: ); val_(io).n=( ((void)L, (floor((( nb)/( nc))))));
settt_(io, LUA_TNUMFLT); };
# Error: ^
# function has no prototype
### mwccmcf Compiler:
# 976: (ra); val_(io).n=( ((void)L, pow( nb, nc))); settt_(io,
LUA_TNUMFLT); };
# Error: ^
# function has no prototype