...
For example, given an implementation that supports 128-bit unsigned integers and provides a uint_fast128_t
type, a programmer may define the following type:
...
The following non-compliant code example reads am an unsigned long long
value from standard input and stores the result in x
, which is of a programmer-defined integer type.
Code Block | ||
---|---|---|
| ||
#include <stdio.h> /* ... */ mytypedef_t x; /* ... */ if(scanf("%llu", &x) != 1) { /* handle error */ } |
Resultantly, this This code could result in a buffer overflow, if the size of mytypedef_t
is smaller than unsigned long long
, or it may might result in an incorrect value if the size of mytypedef_t
is larger than unsigned long long
.
...