Several #define NV_ numeric types are suspect #1293
Description
The symbols NV_INT32
, NV_INT64
and NV_UINT16
are used to set the flags of a struct Namval but are not used to test if those attributes are set. That is highly suspicious. NV_INT32
is just an alias for NV_INTEGER
and the other two set that bit and one other bit. Which suggests that it's only the setting of the NV_INTEGER
bit that matters. But it is also possible that the places which test whether the value is one of those int types is also testing, as one example, that NV_INTEGER
and NV_LONG
being set using two distinct tests rather than testing if NV_INT64
is set. The two approaches are equivalent but highly misleading and will break if NV_INT64
ever becomes a distinct bit in the value type bit-mask.
Similarly there is exactly one use of NV_FLOAT
:
ast/src/cmd/ksh93/bltins/typeset.c
Lines 1275 to 1278 in 70c3d35
This is also highly suspect and implies the correct test at that point is whether NV_DOUBLE
is present.