<s>
The	O
Cyclone	B-Language
programming	I-Language
language	I-Language
is	O
intended	O
to	O
be	O
a	O
safe	O
dialect	O
of	O
the	O
C	B-Language
language	I-Language
.	O
</s>
<s>
Cyclone	B-Language
is	O
designed	O
to	O
avoid	O
buffer	B-General_Concept
overflows	I-General_Concept
and	O
other	O
vulnerabilities	O
that	O
are	O
possible	O
in	O
C	B-Language
programs	I-Language
,	O
without	O
losing	O
the	O
power	O
and	O
convenience	O
of	O
C	B-Language
as	O
a	O
tool	O
for	O
system	B-Application
programming	I-Application
.	O
</s>
<s>
Cyclone	B-Language
development	O
was	O
started	O
as	O
a	O
joint	O
project	O
of	O
AT&T	O
Labs	O
Research	O
and	O
Greg	O
Morrisett	O
's	O
group	O
at	O
Cornell	O
University	O
in	O
2001	O
.	O
</s>
<s>
Cyclone	B-Language
attempts	O
to	O
avoid	O
some	O
of	O
the	O
common	O
pitfalls	O
of	O
C	B-Language
,	O
while	O
still	O
maintaining	O
its	O
look	O
and	O
performance	O
.	O
</s>
<s>
To	O
this	O
end	O
,	O
Cyclone	B-Language
places	O
the	O
following	O
limits	O
on	O
programs	O
:	O
</s>
<s>
To	O
maintain	O
the	O
tool	O
set	O
that	O
C	B-Language
programmers	O
are	O
used	O
to	O
,	O
Cyclone	B-Language
provides	O
the	O
following	O
extensions	O
:	O
</s>
<s>
For	O
a	O
better	O
high-level	O
introduction	O
to	O
Cyclone	B-Language
,	O
the	O
reasoning	O
behind	O
Cyclone	B-Language
and	O
the	O
source	O
of	O
these	O
lists	O
,	O
see	O
.	O
</s>
<s>
Cyclone	B-Language
looks	O
,	O
in	O
general	O
,	O
much	O
like	O
C	B-Language
,	O
but	O
it	O
should	O
be	O
viewed	O
as	O
a	O
C-like	O
language	O
.	O
</s>
<s>
Cyclone	B-Language
implements	O
three	O
kinds	O
of	O
pointer	O
:	O
</s>
<s>
Calling	O
foo(NULL )	O
;	O
will	O
result	O
in	O
undefined	B-Language
behavior	I-Language
(	O
typically	O
,	O
although	O
not	O
necessarily	O
,	O
a	O
SIGSEGV	B-Error_Name
signal	B-General_Concept
being	O
sent	O
to	O
the	O
application	O
)	O
.	O
</s>
<s>
To	O
avoid	O
such	O
problems	O
,	O
Cyclone	B-Language
introduces	O
the	O
@	O
pointer	O
type	O
,	O
which	O
can	O
never	O
be	O
NULL	O
.	O
</s>
<s>
This	O
tells	O
the	O
Cyclone	B-Language
compiler	O
that	O
the	O
argument	O
to	O
foo	O
should	O
never	O
be	O
NULL	O
,	O
avoiding	O
the	O
aforementioned	O
undefined	B-Language
behavior	I-Language
.	O
</s>
<s>
This	O
extra	O
limit	O
,	O
however	O
,	O
can	O
be	O
a	O
rather	O
large	O
stumbling	O
block	O
for	O
most	O
C	B-Language
programmers	O
,	O
who	O
are	O
used	O
to	O
being	O
able	O
to	O
manipulate	O
their	O
pointers	O
directly	O
with	O
arithmetic	O
.	O
</s>
<s>
Although	O
this	O
is	O
desirable	O
,	O
it	O
can	O
lead	O
to	O
buffer	B-General_Concept
overflows	I-General_Concept
and	O
other	O
"	O
off-by-one	O
"	O
-style	O
mistakes	O
.	O
</s>
<s>
Take	O
for	O
instance	O
a	O
simple	O
(	O
and	O
naïve	O
)	O
strlen	O
function	O
,	O
written	O
in	O
C	B-Language
:	O
</s>
<s>
This	O
is	O
perfectly	O
legal	O
in	O
C	B-Language
,	O
yet	O
would	O
cause	O
strlen	O
to	O
iterate	O
through	O
memory	O
not	O
necessarily	O
associated	O
with	O
the	O
string	O
s	O
.	O
There	O
are	O
functions	O
,	O
such	O
as	O
strnlen	O
which	O
can	O
be	O
used	O
to	O
avoid	O
such	O
problems	O
,	O
but	O
these	O
functions	O
are	O
not	O
standard	O
with	O
every	O
implementation	O
of	O
ANSI	O
C	B-Language
.	O
The	O
Cyclone	B-Language
version	O
of	O
strlen	O
is	O
not	O
so	O
different	O
from	O
the	O
C	B-Language
version	O
:	O
</s>
<s>
to	O
*	O
invokes	O
a	O
bounds	B-Data_Structure
check	I-Data_Structure
,	O
and	O
casting	O
from	O
?	O
</s>
<s>
to	O
@	O
invokes	O
both	O
a	O
NULL	O
check	O
and	O
a	O
bounds	B-Data_Structure
check	I-Data_Structure
.	O
</s>
<s>
Consider	O
the	O
following	O
code	O
,	O
in	O
C	B-Language
:	O
</s>
<s>
While	O
GNU	B-Application
Compiler	I-Application
Collection	I-Application
and	O
other	O
compilers	O
will	O
warn	O
about	O
such	O
code	O
,	O
the	O
following	O
will	O
typically	O
compile	O
without	O
warnings	O
:	O
</s>
<s>
GNU	B-Application
Compiler	I-Application
Collection	I-Application
can	O
produce	O
warnings	O
for	O
such	O
code	O
as	O
a	O
side-effect	O
of	O
option	O
or	O
,	O
but	O
there	O
are	O
no	O
guarantees	O
that	O
all	O
such	O
errors	O
will	O
be	O
detected	O
.	O
</s>
<s>
Cyclone	B-Language
does	O
regional	O
analysis	O
of	O
each	O
segment	O
of	O
code	O
,	O
preventing	O
dangling	B-Error_Name
pointers	I-Error_Name
,	O
such	O
as	O
the	O
one	O
returned	O
from	O
this	O
version	O
of	O
itoa	O
.	O
</s>
<s>
Thus	O
,	O
when	O
analyzing	O
itoa	O
,	O
the	O
Cyclone	B-Language
compiler	O
would	O
see	O
that	O
z	O
is	O
a	O
pointer	O
into	O
the	O
local	O
stack	O
,	O
and	O
would	O
report	O
an	O
error	O
.	O
</s>
