PATCH: extensions.html update for bounds checking patches

William Bader william@nscs.fast.net
Fri Jun 2 19:41:00 GMT 2000


*** extensions.html-orig	Fri Jun  2 20:47:27 2000
--- extensions.html	Fri Jun  2 22:35:21 2000
***************
*** 67,72 ****
--- 67,127 ----
  it is still providing some useful services. And, it has proven to
  be a good testsuite for the compiler...
  
+ <h2>
+ Bounds checking patches for
+ <A HREF=" http://www.inter.NL.net/hcc/Haj.Ten.Brugge ">gcc releases</A>
+ and
+ <A HREF=" ftp://nscs.fast.net/pub/binaries/boundschecking ">egcs snapshots</A>
+ </h2>
+ 
+ <p>These patches add a <i>-fbounds-checking</i> flag that
+ adds bounds checking tests to pointer and array accesses.
+ Richard Jones developed the
+ <A HREF=" http://www-ala.doc.ic.ac.uk/~phjk/BoundsChecking.html ">
+ patches against gcc-2.7</A> in 1995.
+ Herman ten Brugge is the current maintainer and has updated the patches for
+ gcc-2.95.2.
+ <a href=" mailto:william@nscs.fast.net ">William Bader</a> has unofficial
+ updates for selected egcs snapshots.
+ 
+ <p>You may freely mix object modules compiled with and without bounds checking.
+ The bounds checker also includes replacements for
+ <i>mem*</i> and <i>str*</i> routines
+ and can detect invalid calls against checked memory objects, even from modules
+ compiled without bounds checking.
+ 
+ <p><code><pre>
+ $ cat example.c
+ main() {
+ char *malloc(); char *a = malloc(2);
+ a[2] = 'x';
+ }
+ $ bgcc-2.95.2 -fbounds-checking example.c
+ $ a.out
+ Bounds Checking GCC v gcc-2.95.2-2.20 Copyright (C) 1995 Richard W.M. Jones
+ Bounds Checking comes with ABSOLUTELY NO WARRANTY. For details see file
+ `COPYING' that should have come with the source to this program.
+ Bounds Checking is free software, and you are welcome to redistribute it
+ under certain conditions. See the file `COPYING' for details.
+ For more information, set GCC_BOUNDS_OPTS to `-help'
+ example.c:3:Bounds error: attempt to reference memory overrunning the end of an object.
+ example.c:3:  Pointer value: 0x8068002, Size: 1
+ example.c:3:  Object `malloc':
+ example.c:3:	Address in memory:    0x8068000 .. 0x8068001
+ example.c:3:	Size:		      2 bytes
+ example.c:3:	Element size:	      1 bytes
+ example.c:3:	Number of elements:   2
+ example.c:3:	Created at:	      example.c, line 2
+ example.c:3:	Storage class:	      heap
+ </pre></code>
+ 
+ <p>These patches are unrelated to the fat pointer bounds checking patches by
+ Greg McGary gkm@eng.ascend.com which change the size of pointers and require
+ building modified versions of libc and most other libraries that your program
+ calls.  Greg's patches will eventually be incorporated into egcs.
+ If you can use Greg's fat pointer bounds checker, it has the advantage of
+ better run-time performance and support for languages other than C.
+ 
  <hr>
  
  <h1>GCC Museum</h1>


More information about the Gcc-patches mailing list