Argument validity checking (addresses)

Ariel Faigon arielf at taux01.UUCP
Sun Feb 4 19:46:34 AEST 1990


Ooops, I just wrote:
#define IN_MY_TEXT(addr) ((void *) &start <= (addr) < (void *) &etext)
                                          ^^^^^^^^^^^
#define IN_MY_HEAP(addr) ((void *) &end <= (addr) < (void *) sbrk(0))
					^^^^^^^^^^^

You need of course separate comparisons here
like in:
	((void *) &start <= (addr) && (addr) < (void *) &etext)

As I said the code wasn't tested, even not reviewed enough. sorry.
-- 
Ariel Faigon, CTP group, NSTA
National Semiconductor (Israel)
6 Maskit st.  P.O.B. 3007, Herzlia 46104, Israel   Tel. (972)52-522312
arielf%taux01 at nsc.com   @{hplabs,pyramid,sun,decwrl} 34 48 E / 32 10 N



More information about the Comp.lang.c mailing list