4 ms·
It's certainly not "illegal", it's merely undefined. Potayto, potahto. Violating language semantics results in undefined behaviour. You can only get less legal
by cygx 14y ago
It's certainly not "illegal", it's merely undefined.
Potayto, potahto. Violating language semantics results in undefined behaviour. You can only get less legal if you add syntax errors into the mix.
You could make the argument that some undefined behaviour should only be considered nonportable instead of erroneous, but personally I consider code that triggers undefined behaviour as invalid or possibly written in a non-standard C dialect.