Hi.

I was trying to get a list of undefined and implementation defined 
behaviors of the Go language from the specification, but it was not easy.
I tried to search for "undefined behavior" and "implementation defined 
behavior" without success.

The ISO C standard use these terms, but the Go specification no.
The ISO C standard also have dedicated sections to undefined and 
implementation defined behaviors, but, well, unlike Go there are a lot of 
them.

Searching for "not specified" in the Go language specification I found:

 - The result of a floating-point or complex division by zero is not
    specified beyond the IEEE-754 standard; whether a run-time panic 
<https://golang.org/ref/spec#Run_time_panics>
    occurs is implementation-specific.

 - However, the order of those events compared to the evaluation
   and indexing of x and the evaluation of y is not specified.

 - The iteration order over maps is not specified and is not guaranteed
   to be the same from one iteration to the next.

 - If one or more of the communications can proceed, a single one that
   can proceed is chosen via a uniform pseudo-random selection.
   Donovan Hide in [1] called this "loosely defined".

>From a golang-nuts thread [1]

 - The conversion of float64 to uint8 has implementation-specific behavior
   for values outside (0, 255).

The Go language specification never mentions undefined behavior, however
Ian Lance Taylor wrote, in [1], that:

 - if your program has a race condition, the behavior is undefined.

[1] https://groups.google.com/forum/#!topic/golang-nuts/MB1QmhDd_Rk:


Is this list complete?


Thanks
Manlio Perillo

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to