3 ms·
That's not possible in general, for instance if you write a block of memory than execute it, you can't really define what's going to happen without including an
by dooglius 8y ago
That's not possible in general, for instance if you write a block of memory than execute it, you can't really define what's going to happen without including an ISA in your language spec. Another example would be executing a syscall with a not-yet-used number. The ability to do both of these things are necessary for a low-level language such as C.
- userbinator 8y agoyou can't really define what's going to happen without including an ISA in your language spec. That's called "implementation-defined".
- dooglius 8y agoTrue, but there are a lot of things that are also undefined at the ISA level
- earenndil 8y agoDon't specify that at all in the standard. Let compilers implement it as an extension, like inline asm. They'll have to make it have sane behaviour because they don't have the excuse of 'the standard says it's ub'.