I'm writing an unpack function which uses "c", "h", "l", "q" format tokens
to specify the type of the integral object pointer. To support fixed-width
types, a la <stdint.h>, another format specifier, "i", can be prefixed with
the width--8, 16, 32, 64, etc. Then, a jump table is used to branch to the
native type conversion based on the size of the native type. (This is
distinct from specifying the number of input bits to consume in the
conversion, and in general disregards the propriety of such fixed-width to
native type-punning.)
Problem: if we don't match a native type, and we wish to soldier on,
discarding input bits and skipping the variable argument without
deferencing, does `va_arg(ap, int *)' exhibit well-defined behavior in
attempting to consume _any_ integral pointer variable argument?
Loose contrapositive: must all integral pointers have the same size?
to specify the type of the integral object pointer. To support fixed-width
types, a la <stdint.h>, another format specifier, "i", can be prefixed with
the width--8, 16, 32, 64, etc. Then, a jump table is used to branch to the
native type conversion based on the size of the native type. (This is
distinct from specifying the number of input bits to consume in the
conversion, and in general disregards the propriety of such fixed-width to
native type-punning.)
Problem: if we don't match a native type, and we wish to soldier on,
discarding input bits and skipping the variable argument without
deferencing, does `va_arg(ap, int *)' exhibit well-defined behavior in
attempting to consume _any_ integral pointer variable argument?
Loose contrapositive: must all integral pointers have the same size?
Comment