[J3] Question about enum input
van.snyder at sbcglobal.net
Sat Mar 25 20:30:24 UTC 2023
Subclause 22.214.171.124 "Integer editing" says that if the effective item
for input is of enum type, the value assigned is the enum value
corresponding to the value of the input field.
Unlike ENUMERATION, ENUM allows to assign a numeric value to an
enumerator. The values of enumerators of ENUM type are not required to
What happens if the input value is not the value of any enumerator of
the ENUM type? Does an error condition exist or is the program simply
not standard conformant? Or is a variable of ENUM type allowed to have
a numeric value that is not the numeric value of any enumerator of the
For input of ENUMERATION type, the value is required to be greater
than zero and not greater than the number of enumerators of the type.
What happens if the value is outside that range? Does an error
condition exist or is the program simply not standard conformant?
12.22.2p2 "Occurrence of input/output conditions" says that the set of
input/output error conditions is processor dependent, so it appears
that a processor is not required to detect these conditions.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the J3