add errsym builtin function

NOTE: errstr was renamed to errsym.

Added errsym builtin function.  The errsym(errnum | "E_STRING")
builtin, , when given a valid integer errnum that corresponds to a
calc error condition, will return an E_STRING string, AND when given
a valid E_STRING string that is associated with a calc error
condition, will return errnum integer that corresponds to a calc
error condition.

Supplying a non-integer numeric errnum code to error(), errno(),
strerror(), or errsym() will result in an error.
This commit is contained in:
Landon Curt Noll
2023-09-20 22:22:49 -07:00
parent 120527d375
commit 1a898caf3f
16 changed files with 366 additions and 55 deletions

View File

@@ -33,6 +33,7 @@
# To replace a Makefile variable, use := symbols. For example:
#
# CCWERR:= -Werror
# DEBUG:= -O0 -g
#
# You can append to an existing Makefile variable using '+=' symbols.
# For example:
@@ -67,7 +68,6 @@
#
# Uncomment these lines:
#
# DEBUG:= -O0 -g
# FSANITIZE:= -fsanitize=undefined -fsanitize=address -fsanitize=bool -fsanitize=bounds
# FSANITIZE+= -fsanitize=enum -fsanitize=vptr -fsanitize=integer-divide-by-zero
# FSANITIZE+= -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow
@@ -77,6 +77,7 @@
# CFLAGS+= -Wno-invalid-command-line-argument ${FSANITIZE} -fno-omit-frame-pointer
# LDFLAGS+= -Wno-invalid-command-line-argument ${FSANITIZE} -fno-omit-frame-pointer
# CALC_ENV+= ASAN_OPTIONS=detect_stack_use_after_return=1
# DEBUG:= -O0 -g
####
####
@@ -98,7 +99,6 @@
#
# Uncomment these lines:
#
# DEBUG:= -O0 -g3
# FSANITIZE:= -fsanitize=undefined -fsanitize=address -fsanitize=bool -fsanitize=bounds
# FSANITIZE+= -fsanitize=enum -fsanitize=vptr -fsanitize=integer-divide-by-zero
# FSANITIZE+= -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow
@@ -109,4 +109,5 @@
# CFLAGS+= -Wno-invalid-command-line-argument ${FSANITIZE} -fno-omit-frame-pointer
# LDFLAGS+= -Wno-invalid-command-line-argument ${FSANITIZE} -fno-omit-frame-pointer
# CALC_ENV+= ASAN_OPTIONS=detect_stack_use_after_return=1
DEBUG:= -O0 -g3
####