Content deleted Content added
Rescuing 1 sources and tagging 1 as dead. #IABot (v1.5beta) |
|||
Line 107:
}
</source>
<source lang="C">
char *itoa(int i)
Line 117:
}
</source>
[[GNU Compiler Collection|gcc]] can produce warnings for such code as a side-effect of option -O2 or -O3, but there are no guarantees that all such errors will be detected.
Cyclone does regional analysis of each segment of code, preventing dangling pointers, such as the one returned from this version of <code>itoa</code>. All of the local variables in a given scope are considered to be part of the same region, separate from the heap or any other local region. Thus, when analyzing <code>itoa</code>, the Cyclone compiler would see that <code>z</code> is a pointer into the local stack, and would report an error.
==See also==
|