Run-time Checks for C

Chris Torek chris at mimsy.UUCP
Sun Nov 20 15:17:45 AEST 1988


>In article <10113 at umn-cs.CS.UMN.EDU> raghavan at umn-cs.cs.umn.edu (Vijay 
>Raghavan) writes:
>>(I mean I'm not sure that sufficient information can always be passed 
>> to the compiler for it to generate code for meaningful run-time checks.) 
>>   Comments?

In article <189 at umigw.MIAMI.EDU> steve at umigw.MIAMI.EDU (steve emmerson)
suggests:
>In general, a pointer to garbage can easily masquerade as valid.

While this is true, if the compiler is careful, and does not provide a
way to get directly at the machine%, the compiler and runtime system
can ensure that the program cannot generate a pointer to garbage.  In
fact, it is possible to apply to C systems most of the run-time checks
common in, e.g., Pascal systems.  There are several companies selling
such systems.  Look around at a Usenix or /usr/group vendor show, for
instance.
-----
% This means no assembly escapes, and requires checking all pointer/
integer and pointer/pointer conversions and/or all pointer references.
In addition to a fairly hefty efficiency price-tag, this does, of
course, make the implementation virtually useless for writing device
drivers for conventional hardware.
-----
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.lang.c mailing list