Topic: assertiveness support from the compiler - making assertions quicker


Author: AlbertoBarbati@libero.it (Alberto Barbati)
Date: Fri, 21 Jan 2005 19:12:21 GMT
Raw View
bsingharora@gmail.com wrote:
>=20
> if (abs((caddr_t)dst - (caddr_t)src)) < n)) {
> return NULL;
> }
>=20

I hope you realize that the line above incurs in undefined behaviour=20
unless both pointers points to elements of the same array (=A75.7/6), so=20
it not a generally valid solution.

Alberto

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]