3 ms·
While you can't get untyped space on the stack, it is explicitly permitted for objects of character type to alias objects of other types. I don't see how effec
by aidenn0 8y ago
While you can't get untyped space on the stack, it is explicitly permitted for objects of character type to alias objects of other types. I don't see how effective_type_3.c has undefined behavior.
- comex 8y agoThe aliasing rule isn’t symmetric: you can access objects originally declared as types other than char using char pointers, but you can’t access objects originally declared as char using non-char pointers. (And malloc()ed buffers are neither of the above and have their own rule.) Here’s a blog post explaining it in more detail: https://gustedt.wordpress.com/2016/08/17/effective-types-and-aliasing/ https://gustedt.wordpress.com/2016/08/17/effective-types-and...