@newt @GNUxeava @novaburst No, it's not. Show me where the spec is confusing http://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf
And 99% of C programs are compiled with just -Wall and whatever -Is, -Ds, and -ls you need. Maybe you add -std= if you want to be pedantic, but it almost always works
@newt @GNUxeava @novaburst Compilers give you a warning when aliasing so you can give it the correct option. That's not a problem, nor typical.
The compiler might play with the padding bits to optimise the behaviour. That's explicit. Undefined behaviour lets the implementation make the most appropriate choice for speed.
Mallocs can be the same between processes because of paging, and if they both return NULL, otherwise it's unique (according to man malloc), obviously.
If you think undefined behaviour means poorly written, you're very confused. None of those are things the average user will ever run into btw.
@newt @GNUxeava @novaburst No, it's not. It's explicit about what is undefined behaviour.
If you don't have padding bits, you can't treat the struct as a whole block. If you have to leave the padding bits alone, then you can't do something like setting a whole block of memory when setting multiple values in fewer instructions. There's no way to solve this without being slower, nor do you ever care about the padding bits.
If your goal is security the entire thing is thrown out the window from having retarded amounts of code (plus npm levels of package bloat and quality) that might at any point call an unsafe block of code. You should write it in an *actually* safe language, or just use static analysis tools, which is basically what rust is. C++ with somehow shittier syntax and the slowest static analyser in the world.
First, how come most GNU code (take GTK, for one) requires -fno-strict-aliasing?
Second, if you zero a structure and then set some of the fields, will the padding bits all be zero? This one is my favorite. Try reading the C spec about it and come up with an answer.
Third, this is the fun part. Can the results of two calls to malloc() ever be equal?