(no title)
CryZe | 3 months ago
Quick example:
typedef struct Foo {
int buf[2];
float some_float;
} Foo;int main(void) {
Foo foo = {0};
for (size_t i = 0; i < 3; ++i) {
foo.buf[i] = 0x3f000000;
printf("foo.buf[%zu]: %d\n", i, foo.buf[i]);
}
printf("foo.some_float: %f\n", foo.some_float);
}This overflows into the float, not causing any panics, printing 0.5 for the float.
No comments yet.