[cap-talk] David Wagner's Google techtalk is now up!

James A. Donald jamesd at echeque.com
Thu Dec 13 18:14:55 EST 2007


Rob Meijer wrote:
 > Wouldn't it be possible to define a set of checks for
 > the C++ compiler that would allow to achieve this? For
 > example a check to validate the code uses auto_ptr or
 > boost shared_ptr/weak_ptr or maybe boost intrusive_ptr
 > instead of raw pointers, would be very valuable if
 > possible. Some simpler but just as important would be
 > things like const_cast and reinterpret_cast.

The analysis that a compiler does in order to optimize,
is very similar to the analysis that a compiler would
need to do to ensure that that pointers always point to
values of the correct type for the operation - enabling
compile time enforcement of type safety, allowing
compile time detection of a large class of errors, for
example buffer overflows, and, with suitable type
definitions, strong limits on what a program could do,
including compile time restrictions on a program
utilizing ambient authority, by, for example, making
file handles a type with suitable restrictions.

"Secure Virtual Architecture" seems to be a proposal to
implement one form of this idea, an ingenious trick for
handling existing code that is apt to pass routines
pointers without providing information on the limits of
the validity of the pointers, but not, as far as I can
tell, an actual implementation of this idea.

Other posts in this thread have assured me that such
things already exist, but as far as I can tell, they
exist only in the sense that mathematicians regard
platonic ideals as existing, not in the form of actually
useful implementations.


More information about the cap-talk mailing list