3 ms·
> What's wrong with the division by zero issue? It works just like in Go? As I understand it, V's emitted C code (in release mode) does not handle the possibil
by enragedcacti 4y ago
> What's wrong with the division by zero issue? It works just like in Go?
As I understand it, V's emitted C code (in release mode) does not handle the possibility of a divide by zero. As such, according to the C spec, you've now entered territory where literally anything could happen depending on how the compiler or platform is implemented.
Go, alternatively, detects a divide by zero and panics (like V does in debug mode) which will consistently occur regardless of compiler or platform because it is defined behavior.
In the case of the user in the issue, he got a SIGILL but other OSes, compiler versions, architectures, etc. could result in some other outcome entirely.
I'm not familiar with where V is ported to, do all the supported platforms result in the same behavior?