Index: benchmark/Makefile.in
===================================================================
--- benchmark/Makefile.in	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ benchmark/Makefile.in	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -352,6 +352,5 @@
 LTCFACOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=compile $(CFACC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFAFLAGS) $(CFAFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFAFLAGS) $(AM_CFLAGS) $(CFAFLAGS) $(CFLAGS)
 
 AM_V_CFA = $(am__v_CFA_@AM_V@)
Index: driver/cfa.cc
===================================================================
--- driver/cfa.cc	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ driver/cfa.cc	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -401,4 +401,6 @@
 		args[nargs++] = "-Xlinker";
 		args[nargs++] = "--undefined=__cfaabi_appready_startup";
+		args[nargs++] = "-z";
+		args[nargs++] = "execstack";
 
 		// include the cfa library in case it is needed
@@ -409,5 +411,5 @@
 		args[nargs++] = "-Wl,--pop-state";
 		args[nargs++] = "-lcfa";
-		args[nargs++] = "-lpthread";
+		args[nargs++] = "-pthread";
 		args[nargs++] = "-ldl";
 		args[nargs++] = "-lrt";
Index: libcfa/configure
===================================================================
--- libcfa/configure	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/configure	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -3000,5 +3000,5 @@
 case $CONFIGURATION in
 	"debug"   )
-		CONFIG_CFLAGS="-Og -g"
+		CONFIG_CFLAGS="-O0 -g"
 		CONFIG_CFAFLAGS="-debug"
 		CONFIG_BUILDLIB="yes"
Index: libcfa/configure.ac
===================================================================
--- libcfa/configure.ac	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/configure.ac	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -68,5 +68,5 @@
 case $CONFIGURATION in
 	"debug"   )
-		CONFIG_CFLAGS="-Og -g"
+		CONFIG_CFLAGS="-O0 -g"
 		CONFIG_CFAFLAGS="-debug"
 		CONFIG_BUILDLIB="yes"
Index: libcfa/src/Makefile.am
===================================================================
--- libcfa/src/Makefile.am	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/Makefile.am	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -33,5 +33,5 @@
 # The built sources must not depend on the installed headers
 AM_CFAFLAGS = -quiet -cfalib -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb) @CONFIG_CFAFLAGS@
-AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@
+AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC -pthread @ARCH_FLAGS@ @CONFIG_CFLAGS@
 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@
 CFACC = @CFACC@
Index: libcfa/src/Makefile.in
===================================================================
--- libcfa/src/Makefile.in	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/Makefile.in	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -417,6 +417,5 @@
 LTCFACOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=compile $(CFACC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFAFLAGS) $(CFAFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFAFLAGS) $(AM_CFLAGS) $(CFAFLAGS) $(CFLAGS)
 
 AM_V_CFA = $(am__v_CFA_@AM_V@)
@@ -446,5 +445,5 @@
 # The built sources must not depend on the installed headers
 AM_CFAFLAGS = -quiet -cfalib -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb) @CONFIG_CFAFLAGS@
-AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@
+AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC -pthread @ARCH_FLAGS@ @CONFIG_CFLAGS@
 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@
 @BUILDLIB_FALSE@headers_nosrc = 
Index: libcfa/src/concurrency/alarm.cfa
===================================================================
--- libcfa/src/concurrency/alarm.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/alarm.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Fri Jun 2 11:31:25 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri May 25 06:25:47 2018
-// Update Count     : 67
+// Last Modified On : Tue Dec  3 22:47:24 2019
+// Update Count     : 68
 //
 
@@ -40,5 +40,5 @@
 void __kernel_set_timer( Duration alarm ) {
 	verifyf(alarm >= 1`us || alarm == 0, "Setting timer to < 1us (%jins)", alarm.tv);
-	setitimer( ITIMER_REAL, &(itimerval){ alarm }, NULL );
+	setitimer( ITIMER_REAL, &(itimerval){ alarm }, 0p );
 }
 
@@ -113,5 +113,5 @@
 			this->tail = &this->head;
 		}
-		head->next = NULL;
+		head->next = 0p;
 	}
 	verify( validate( this ) );
@@ -127,5 +127,5 @@
 		this->tail = it;
 	}
-	n->next = NULL;
+	n->next = 0p;
 
 	verify( validate( this ) );
Index: libcfa/src/concurrency/coroutine.cfa
===================================================================
--- libcfa/src/concurrency/coroutine.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/coroutine.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Mon Nov 28 12:27:26 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Mar 30 17:20:57 2018
-// Update Count     : 9
+// Last Modified On : Thu Dec  5 14:37:29 2019
+// Update Count     : 15
 //
 
@@ -90,11 +90,11 @@
 
 void ?{}( coroutine_desc & this, const char * name, void * storage, size_t storageSize ) with( this ) {
-	(this.context){NULL, NULL};
+	(this.context){0p, 0p};
 	(this.stack){storage, storageSize};
 	this.name = name;
 	state = Start;
-	starter = NULL;
-	last = NULL;
-	cancellation = NULL;
+	starter = 0p;
+	last = 0p;
+	cancellation = 0p;
 }
 
@@ -131,5 +131,5 @@
 
 [void *, size_t] __stack_alloc( size_t storageSize ) {
-	static const size_t stack_data_size = libCeiling( sizeof(__stack_t), 16 ); // minimum alignment
+	const size_t stack_data_size = libCeiling( sizeof(__stack_t), 16 ); // minimum alignment
 	assert(__page_size != 0l);
 	size_t size = libCeiling( storageSize, 16 ) + stack_data_size;
@@ -157,5 +157,5 @@
 
 void __stack_prepare( __stack_info_t * this, size_t create_size ) {
-	static const size_t stack_data_size = libCeiling( sizeof(__stack_t), 16 ); // minimum alignment
+	const size_t stack_data_size = libCeiling( sizeof(__stack_t), 16 ); // minimum alignment
 	bool userStack;
 	void * storage;
Index: libcfa/src/concurrency/coroutine.hfa
===================================================================
--- libcfa/src/concurrency/coroutine.hfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/coroutine.hfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Mon Nov 28 12:27:26 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jun 21 17:49:39 2019
-// Update Count     : 9
+// Last Modified On : Tue Dec  3 22:47:58 2019
+// Update Count     : 10
 //
 
@@ -38,9 +38,9 @@
 void ^?{}( coroutine_desc & this );
 
-static inline void ?{}( coroutine_desc & this)                                       { this{ "Anonymous Coroutine", NULL, 0 }; }
-static inline void ?{}( coroutine_desc & this, size_t stackSize)                     { this{ "Anonymous Coroutine", NULL, stackSize }; }
+static inline void ?{}( coroutine_desc & this)                                       { this{ "Anonymous Coroutine", 0p, 0 }; }
+static inline void ?{}( coroutine_desc & this, size_t stackSize)                     { this{ "Anonymous Coroutine", 0p, stackSize }; }
 static inline void ?{}( coroutine_desc & this, void * storage, size_t storageSize )  { this{ "Anonymous Coroutine", storage, storageSize }; }
-static inline void ?{}( coroutine_desc & this, const char * name)                    { this{ name, NULL, 0 }; }
-static inline void ?{}( coroutine_desc & this, const char * name, size_t stackSize ) { this{ name, NULL, stackSize }; }
+static inline void ?{}( coroutine_desc & this, const char * name)                    { this{ name, 0p, 0 }; }
+static inline void ?{}( coroutine_desc & this, const char * name, size_t stackSize ) { this{ name, 0p, stackSize }; }
 
 //-----------------------------------------------------------------------------
@@ -89,5 +89,5 @@
 	src->state = Active;
 
-	if( unlikely(src->cancellation != NULL) ) {
+	if( unlikely(src->cancellation != 0p) ) {
 		_CtxCoroutine_Unwind(src->cancellation, src);
 	}
@@ -128,5 +128,5 @@
 	coroutine_desc * dst = get_coroutine(cor);
 
-	if( unlikely(dst->context.SP == NULL) ) {
+	if( unlikely(dst->context.SP == 0p) ) {
 		__stack_prepare(&dst->stack, 65000);
 		CtxStart(&cor, CtxInvokeCoroutine);
Index: libcfa/src/concurrency/invoke.h
===================================================================
--- libcfa/src/concurrency/invoke.h	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/invoke.h	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jun 22 18:19:13 2019
-// Update Count     : 40
+// Last Modified On : Thu Dec  5 16:26:03 2019
+// Update Count     : 44
 //
 
@@ -215,5 +215,5 @@
 
 		static inline void ?{}(__monitor_group_t & this) {
-			(this.data){NULL};
+			(this.data){0p};
 			(this.size){0};
 			(this.func){NULL};
Index: libcfa/src/concurrency/kernel.cfa
===================================================================
--- libcfa/src/concurrency/kernel.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/kernel.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Nov 21 16:46:59 2019
-// Update Count     : 27
+// Last Modified On : Thu Dec  5 16:25:52 2019
+// Update Count     : 52
 //
 
@@ -26,4 +26,6 @@
 #include <signal.h>
 #include <unistd.h>
+#include <limits.h>										// PTHREAD_STACK_MIN
+#include <sys/mman.h>									// mprotect
 }
 
@@ -40,5 +42,5 @@
 //-----------------------------------------------------------------------------
 // Some assembly required
-#if   defined( __i386 )
+#if defined( __i386 )
 	#define CtxGet( ctx )        \
 		__asm__ volatile (     \
@@ -123,5 +125,5 @@
 
 extern "C" {
-struct { __dllist_t(cluster) list; __spinlock_t lock; } __cfa_dbg_global_clusters;
+	struct { __dllist_t(cluster) list; __spinlock_t lock; } __cfa_dbg_global_clusters;
 }
 
@@ -131,5 +133,5 @@
 // Global state
 thread_local struct KernelThreadData kernelTLS __attribute__ ((tls_model ( "initial-exec" ))) = {
-	NULL,
+	NULL,												// cannot use 0p
 	NULL,
 	{ 1, false, false },
@@ -140,8 +142,8 @@
 // Struct to steal stack
 struct current_stack_info_t {
-	__stack_t * storage;		// pointer to stack object
-	void *base;				// base of stack
-	void *limit;			// stack grows towards stack limit
-	void *context;			// address of cfa_context_t
+	__stack_t * storage;								// pointer to stack object
+	void * base;										// base of stack
+	void * limit;										// stack grows towards stack limit
+	void * context;										// address of cfa_context_t
 };
 
@@ -172,7 +174,7 @@
 	name = "Main Thread";
 	state = Start;
-	starter = NULL;
-	last = NULL;
-	cancellation = NULL;
+	starter = 0p;
+	last = 0p;
+	cancellation = 0p;
 }
 
@@ -188,6 +190,6 @@
 	link.prev = 0p;
 
-	node.next = NULL;
-	node.prev = NULL;
+	node.next = 0p;
+	node.prev = 0p;
 	doregister(curr_cluster, this);
 
@@ -214,5 +216,5 @@
 	terminated{ 0 };
 	do_terminate = false;
-	preemption_alarm = NULL;
+	preemption_alarm = 0p;
 	pending_preemption = false;
 	runner.proc = &this;
@@ -234,5 +236,6 @@
 	}
 
-	pthread_join( kernel_thread, NULL );
+	pthread_join( kernel_thread, 0p );
+	free( this.stack );
 }
 
@@ -284,11 +287,9 @@
 		__cfaabi_dbg_print_safe("Kernel : core %p started\n", this);
 
-		thread_desc * readyThread = NULL;
-		for( unsigned int spin_count = 0; ! __atomic_load_n(&this->do_terminate, __ATOMIC_SEQ_CST); spin_count++ )
-		{
+		thread_desc * readyThread = 0p;
+		for( unsigned int spin_count = 0; ! __atomic_load_n(&this->do_terminate, __ATOMIC_SEQ_CST); spin_count++ ) {
 			readyThread = nextThread( this->cltr );
 
-			if(readyThread)
-			{
+			if(readyThread) {
 				verify( ! kernelTLS.preemption_state.enabled );
 
@@ -301,7 +302,5 @@
 
 				spin_count = 0;
-			}
-			else
-			{
+			} else {
 				// spin(this, &spin_count);
 				halt(this);
@@ -423,5 +422,5 @@
 	processor * proc = (processor *) arg;
 	kernelTLS.this_processor = proc;
-	kernelTLS.this_thread    = NULL;
+	kernelTLS.this_thread    = 0p;
 	kernelTLS.preemption_state.[enabled, disable_count] = [false, 1];
 	// SKULLDUGGERY: We want to create a context for the processor coroutine
@@ -436,5 +435,5 @@
 
 	//Set global state
-	kernelTLS.this_thread    = NULL;
+	kernelTLS.this_thread = 0p;
 
 	//We now have a proper context from which to schedule threads
@@ -452,5 +451,39 @@
 	__cfaabi_dbg_print_safe("Kernel : core %p main ended (%p)\n", proc, &proc->runner);
 
-	return NULL;
+	return 0p;
+}
+
+static void Abort( int ret, const char * func ) {
+	if ( ret ) {										// pthread routines return errno values
+		abort( "%s : internal error, error(%d) %s.", func, ret, strerror( ret ) );
+	} // if
+} // Abort
+
+void * create_pthread( pthread_t * pthread, void * (*start)(void *), void * arg ) {
+	pthread_attr_t attr;
+
+	Abort( pthread_attr_init( &attr ), "pthread_attr_init" ); // initialize attribute
+
+	size_t stacksize;
+	// default stack size, normally defined by shell limit
+	Abort( pthread_attr_getstacksize( &attr, &stacksize ), "pthread_attr_getstacksize" );
+	assert( stacksize >= PTHREAD_STACK_MIN );
+
+	void * stack;
+	__cfaabi_dbg_debug_do(
+		stack = memalign( __page_size, stacksize + __page_size );
+		// pthread has no mechanism to create the guard page in user supplied stack.
+		if ( mprotect( stack, __page_size, PROT_NONE ) == -1 ) {
+			abort( "mprotect : internal error, mprotect failure, error(%d) %s.", errno, strerror( errno ) );
+		} // if
+	);
+	__cfaabi_dbg_no_debug_do(
+		stack = malloc( stacksize );
+	);
+
+	Abort( pthread_attr_setstack( &attr, stack, stacksize ), "pthread_attr_setstack" );
+
+	Abort( pthread_create( pthread, &attr, start, arg ), "pthread_create" );
+	return stack;
 }
 
@@ -458,5 +491,5 @@
 	__cfaabi_dbg_print_safe("Kernel : Starting core %p\n", this);
 
-	pthread_create( &this->kernel_thread, NULL, CtxInvokeProcessor, (void*)this );
+	this->stack = create_pthread( &this->kernel_thread, CtxInvokeProcessor, (void *)this );
 
 	__cfaabi_dbg_print_safe("Kernel : core %p started\n", this);
@@ -515,5 +548,5 @@
 	verify( ! kernelTLS.preemption_state.enabled );
 
-	verifyf( thrd->link.next == NULL, "Expected null got %p", thrd->link.next );
+	verifyf( thrd->link.next == 0p, "Expected null got %p", thrd->link.next );
 
 
@@ -695,5 +728,5 @@
 	void ?{}(processorCtx_t & this, processor * proc) {
 		(this.__cor){ "Processor" };
-		this.__cor.starter = NULL;
+		this.__cor.starter = 0p;
 		this.proc = proc;
 	}
@@ -704,5 +737,5 @@
 		terminated{ 0 };
 		do_terminate = false;
-		preemption_alarm = NULL;
+		preemption_alarm = 0p;
 		pending_preemption = false;
 		kernel_thread = pthread_self();
@@ -907,5 +940,5 @@
 
 void V(semaphore & this) with( this ) {
-	thread_desc * thrd = NULL;
+	thread_desc * thrd = 0p;
 	lock( lock __cfaabi_dbg_ctx2 );
 	count += 1;
Index: libcfa/src/concurrency/kernel.hfa
===================================================================
--- libcfa/src/concurrency/kernel.hfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/kernel.hfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jun 22 11:39:17 2019
-// Update Count     : 16
+// Last Modified On : Wed Dec  4 07:54:51 2019
+// Update Count     : 18
 //
 
@@ -89,6 +89,6 @@
 static inline void ?{}(FinishAction & this) {
 	this.action_code = No_Action;
-	this.thrd = NULL;
-	this.lock = NULL;
+	this.thrd = 0p;
+	this.lock = 0p;
 }
 static inline void ^?{}(FinishAction &) {}
@@ -135,4 +135,7 @@
 	// Termination synchronisation
 	semaphore terminated;
+
+	// pthread Stack
+	void * stack;
 
 	// Link lists fields
Index: libcfa/src/concurrency/kernel_private.hfa
===================================================================
--- libcfa/src/concurrency/kernel_private.hfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/kernel_private.hfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Mon Feb 13 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Mar 29 14:06:40 2018
-// Update Count     : 3
+// Last Modified On : Sat Nov 30 19:25:02 2019
+// Update Count     : 8
 //
 
@@ -57,4 +57,6 @@
 void main(processorCtx_t *);
 
+void * create_pthread( pthread_t *, void * (*)(void *), void * );
+
 static inline void wake_fast(processor * this) {
 	__cfaabi_dbg_print_safe("Kernel : Waking up processor %p\n", this);
Index: libcfa/src/concurrency/monitor.cfa
===================================================================
--- libcfa/src/concurrency/monitor.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/monitor.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Thd Feb 23 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Mar 30 14:30:26 2018
-// Update Count     : 9
+// Last Modified On : Wed Dec  4 07:55:14 2019
+// Update Count     : 10
 //
 
@@ -363,5 +363,5 @@
 	this.waiting_thread = waiting_thread;
 	this.count = count;
-	this.next = NULL;
+	this.next = 0p;
 	this.user_info = user_info;
 }
@@ -369,7 +369,7 @@
 void ?{}(__condition_criterion_t & this ) with( this ) {
 	ready  = false;
-	target = NULL;
-	owner  = NULL;
-	next   = NULL;
+	target = 0p;
+	owner  = 0p;
+	next   = 0p;
 }
 
@@ -378,5 +378,5 @@
 	this.target = target;
 	this.owner  = &owner;
-	this.next   = NULL;
+	this.next   = 0p;
 }
 
@@ -387,5 +387,5 @@
 
 	// Check that everything is as expected
-	assertf( this.monitors != NULL, "Waiting with no monitors (%p)", this.monitors );
+	assertf( this.monitors != 0p, "Waiting with no monitors (%p)", this.monitors );
 	verifyf( this.monitor_count != 0, "Waiting with 0 monitors (%"PRIiFAST16")", this.monitor_count );
 	verifyf( this.monitor_count < 32u, "Excessive monitor count (%"PRIiFAST16")", this.monitor_count );
@@ -449,5 +449,5 @@
 
 	// Lock all monitors
-	lock_all( this.monitors, NULL, count );
+	lock_all( this.monitors, 0p, count );
 
 	//Pop the head of the waiting queue
@@ -471,5 +471,5 @@
 
 	//Check that everything is as expected
-	verifyf( this.monitors != NULL, "Waiting with no monitors (%p)", this.monitors );
+	verifyf( this.monitors != 0p, "Waiting with no monitors (%p)", this.monitors );
 	verifyf( this.monitor_count != 0, "Waiting with 0 monitors (%"PRIiFAST16")", this.monitor_count );
 
@@ -674,6 +674,6 @@
 
 static inline void reset_mask( monitor_desc * this ) {
-	this->mask.accepted = NULL;
-	this->mask.data = NULL;
+	this->mask.accepted = 0p;
+	this->mask.data = 0p;
 	this->mask.size = 0;
 }
@@ -816,6 +816,6 @@
 	}
 
-	__cfaabi_dbg_print_safe( "Kernel :  Runing %i (%p)\n", ready2run, ready2run ? node->waiting_thread : NULL );
-	return ready2run ? node->waiting_thread : NULL;
+	__cfaabi_dbg_print_safe( "Kernel :  Runing %i (%p)\n", ready2run, ready2run ? node->waiting_thread : 0p );
+	return ready2run ? node->waiting_thread : 0p;
 }
 
@@ -824,5 +824,5 @@
 	if( !this.monitors ) {
 		// __cfaabi_dbg_print_safe( "Branding\n" );
-		assertf( thrd->monitors.data != NULL, "No current monitor to brand condition %p", thrd->monitors.data );
+		assertf( thrd->monitors.data != 0p, "No current monitor to brand condition %p", thrd->monitors.data );
 		this.monitor_count = thrd->monitors.size;
 
Index: libcfa/src/concurrency/monitor.hfa
===================================================================
--- libcfa/src/concurrency/monitor.hfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/monitor.hfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Thd Feb 23 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Oct  7 18:06:45 2017
-// Update Count     : 10
+// Last Modified On : Wed Dec  4 07:55:32 2019
+// Update Count     : 11
 //
 
@@ -31,10 +31,10 @@
 	entry_queue{};
 	signal_stack{};
-	owner         = NULL;
+	owner         = 0p;
 	recursion     = 0;
-	mask.accepted = NULL;
-	mask.data     = NULL;
+	mask.accepted = 0p;
+	mask.data     = 0p;
 	mask.size     = 0;
-	dtor_node     = NULL;
+	dtor_node     = 0p;
 }
 
@@ -122,5 +122,5 @@
 
 static inline void ?{}( condition & this ) {
-	this.monitors = NULL;
+	this.monitors = 0p;
 	this.monitor_count = 0;
 }
Index: libcfa/src/concurrency/mutex.cfa
===================================================================
--- libcfa/src/concurrency/mutex.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/mutex.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -11,7 +11,7 @@
 // Author           : Thierry Delisle
 // Created On       : Fri May 25 01:37:11 2018
-// Last Modified By : Thierry Delisle
-// Last Modified On : Fri May 25 01:37:51 2018
-// Update Count     : 0
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Dec  4 09:16:39 2019
+// Update Count     : 1
 //
 
@@ -73,5 +73,5 @@
 	this.lock{};
 	this.blocked_threads{};
-	this.owner = NULL;
+	this.owner = 0p;
 	this.recursion_count = 0;
 }
@@ -83,5 +83,5 @@
 void lock(recursive_mutex_lock & this) with(this) {
 	lock( lock __cfaabi_dbg_ctx2 );
-	if( owner == NULL ) {
+	if( owner == 0p ) {
 		owner = kernelTLS.this_thread;
 		recursion_count = 1;
@@ -101,5 +101,5 @@
 	bool ret = false;
 	lock( lock __cfaabi_dbg_ctx2 );
-	if( owner == NULL ) {
+	if( owner == 0p ) {
 		owner = kernelTLS.this_thread;
 		recursion_count = 1;
Index: libcfa/src/concurrency/mutex.hfa
===================================================================
--- libcfa/src/concurrency/mutex.hfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/mutex.hfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -11,7 +11,7 @@
 // Author           : Thierry Delisle
 // Created On       : Fri May 25 01:24:09 2018
-// Last Modified By : Thierry Delisle
-// Last Modified On : Fri May 25 01:24:12 2018
-// Update Count     : 0
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Dec  4 09:16:53 2019
+// Update Count     : 1
 //
 
@@ -110,5 +110,5 @@
 
 	static inline void ?{}(lock_scope(L) & this) {
-		this.locks = NULL;
+		this.locks = 0p;
 		this.count = 0;
 	}
Index: libcfa/src/concurrency/preemption.cfa
===================================================================
--- libcfa/src/concurrency/preemption.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/preemption.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Mon Jun 5 14:20:42 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Jun  5 17:35:49 2018
-// Update Count     : 37
+// Last Modified On : Thu Dec  5 16:34:05 2019
+// Update Count     : 43
 //
 
@@ -24,4 +24,5 @@
 #include <string.h>
 #include <unistd.h>
+#include <limits.h>										// PTHREAD_STACK_MIN
 }
 
@@ -64,4 +65,5 @@
 event_kernel_t * event_kernel;                        // kernel public handle to even kernel
 static pthread_t alarm_thread;                        // pthread handle to alarm thread
+static void * alarm_stack;							  // pthread stack for alarm thread
 
 static void ?{}(event_kernel_t & this) with( this ) {
@@ -81,14 +83,14 @@
 // Get next expired node
 static inline alarm_node_t * get_expired( alarm_list_t * alarms, Time currtime ) {
-	if( !alarms->head ) return NULL;                          // If no alarms return null
-	if( alarms->head->alarm >= currtime ) return NULL;        // If alarms head not expired return null
-	return pop(alarms);                                       // Otherwise just pop head
+	if( !alarms->head ) return 0p;						// If no alarms return null
+	if( alarms->head->alarm >= currtime ) return 0p;	// If alarms head not expired return null
+	return pop(alarms);									// Otherwise just pop head
 }
 
 // Tick one frame of the Discrete Event Simulation for alarms
 static void tick_preemption() {
-	alarm_node_t * node = NULL;                     // Used in the while loop but cannot be declared in the while condition
-	alarm_list_t * alarms = &event_kernel->alarms;  // Local copy for ease of reading
-	Time currtime = __kernel_get_time();			// Check current time once so we everything "happens at once"
+	alarm_node_t * node = 0p;							// Used in the while loop but cannot be declared in the while condition
+	alarm_list_t * alarms = &event_kernel->alarms;		// Local copy for ease of reading
+	Time currtime = __kernel_get_time();				// Check current time once so everything "happens at once"
 
 	//Loop throught every thing expired
@@ -243,5 +245,5 @@
 	sigaddset( &mask, sig );
 
-	if ( pthread_sigmask( SIG_UNBLOCK, &mask, NULL ) == -1 ) {
+	if ( pthread_sigmask( SIG_UNBLOCK, &mask, 0p ) == -1 ) {
 	    abort( "internal error, pthread_sigmask" );
 	}
@@ -254,5 +256,5 @@
 	sigaddset( &mask, sig );
 
-	if ( pthread_sigmask( SIG_BLOCK, &mask, NULL ) == -1 ) {
+	if ( pthread_sigmask( SIG_BLOCK, &mask, 0p ) == -1 ) {
 	    abort( "internal error, pthread_sigmask" );
 	}
@@ -301,9 +303,9 @@
 
 	// Setup proper signal handlers
-	__cfaabi_sigaction( SIGUSR1, sigHandler_ctxSwitch, SA_SIGINFO | SA_RESTART );         // CtxSwitch handler
+	__cfaabi_sigaction( SIGUSR1, sigHandler_ctxSwitch, SA_SIGINFO | SA_RESTART ); // CtxSwitch handler
 
 	signal_block( SIGALRM );
 
-	pthread_create( &alarm_thread, NULL, alarm_loop, NULL );
+	alarm_stack = create_pthread( &alarm_thread, alarm_loop, 0p );
 }
 
@@ -316,5 +318,5 @@
 	sigset_t mask;
 	sigfillset( &mask );
-	sigprocmask( SIG_BLOCK, &mask, NULL );
+	sigprocmask( SIG_BLOCK, &mask, 0p );
 
 	// Notify the alarm thread of the shutdown
@@ -323,5 +325,7 @@
 
 	// Wait for the preemption thread to finish
-	pthread_join( alarm_thread, NULL );
+
+	pthread_join( alarm_thread, 0p );
+	free( alarm_stack );
 
 	// Preemption is now fully stopped
@@ -380,5 +384,5 @@
 	static_assert( sizeof( sigset_t ) == sizeof( cxt->uc_sigmask ), "Expected cxt->uc_sigmask to be of sigset_t" );
 	#endif
-	if ( pthread_sigmask( SIG_SETMASK, (sigset_t *)&(cxt->uc_sigmask), NULL ) == -1 ) {
+	if ( pthread_sigmask( SIG_SETMASK, (sigset_t *)&(cxt->uc_sigmask), 0p ) == -1 ) {
 		abort( "internal error, sigprocmask" );
 	}
@@ -399,5 +403,5 @@
 	sigset_t mask;
 	sigfillset(&mask);
-	if ( pthread_sigmask( SIG_BLOCK, &mask, NULL ) == -1 ) {
+	if ( pthread_sigmask( SIG_BLOCK, &mask, 0p ) == -1 ) {
 	    abort( "internal error, pthread_sigmask" );
 	}
@@ -420,5 +424,5 @@
 					{__cfaabi_dbg_print_buffer_decl( " KERNEL: Spurious wakeup %d.\n", err );}
 					continue;
-       			case EINVAL :
+				case EINVAL :
 				 	abort( "Timeout was invalid." );
 				default:
@@ -453,5 +457,5 @@
 EXIT:
 	__cfaabi_dbg_print_safe( "Kernel : Preemption thread stopping\n" );
-	return NULL;
+	return 0p;
 }
 
@@ -466,5 +470,5 @@
 	sigset_t oldset;
 	int ret;
-	ret = pthread_sigmask(0, NULL, &oldset);
+	ret = pthread_sigmask(0, 0p, &oldset);
 	if(ret != 0) { abort("ERROR sigprocmask returned %d", ret); }
 
Index: libcfa/src/concurrency/thread.cfa
===================================================================
--- libcfa/src/concurrency/thread.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/thread.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Mar 30 17:19:52 2018
-// Update Count     : 8
+// Last Modified On : Wed Dec  4 09:17:49 2019
+// Update Count     : 9
 //
 
@@ -33,5 +33,5 @@
 // Thread ctors and dtors
 void ?{}(thread_desc & this, const char * const name, cluster & cl, void * storage, size_t storageSize ) with( this ) {
-	context{ NULL, NULL };
+	context{ 0p, 0p };
 	self_cor{ name, storage, storageSize };
 	state = Start;
@@ -44,6 +44,6 @@
 	link.prev = 0p;
 
-	node.next = NULL;
-	node.prev = NULL;
+	node.next = 0p;
+	node.prev = 0p;
 	doregister(curr_cluster, this);
 
Index: libcfa/src/concurrency/thread.hfa
===================================================================
--- libcfa/src/concurrency/thread.hfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/thread.hfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jun 21 17:51:33 2019
-// Update Count     : 5
+// Last Modified On : Wed Dec  4 09:18:14 2019
+// Update Count     : 6
 //
 
@@ -61,13 +61,13 @@
 void ^?{}(thread_desc & this);
 
-static inline void ?{}(thread_desc & this)                                                                  { this{ "Anonymous Thread", *mainCluster, NULL, 65000 }; }
-static inline void ?{}(thread_desc & this, size_t stackSize )                                               { this{ "Anonymous Thread", *mainCluster, NULL, stackSize }; }
+static inline void ?{}(thread_desc & this)                                                                  { this{ "Anonymous Thread", *mainCluster, 0p, 65000 }; }
+static inline void ?{}(thread_desc & this, size_t stackSize )                                               { this{ "Anonymous Thread", *mainCluster, 0p, stackSize }; }
 static inline void ?{}(thread_desc & this, void * storage, size_t storageSize )                             { this{ "Anonymous Thread", *mainCluster, storage, storageSize }; }
-static inline void ?{}(thread_desc & this, struct cluster & cl )                                            { this{ "Anonymous Thread", cl, NULL, 65000 }; }
-static inline void ?{}(thread_desc & this, struct cluster & cl, size_t stackSize )                          { this{ "Anonymous Thread", cl, NULL, stackSize }; }
+static inline void ?{}(thread_desc & this, struct cluster & cl )                                            { this{ "Anonymous Thread", cl, 0p, 65000 }; }
+static inline void ?{}(thread_desc & this, struct cluster & cl, size_t stackSize )                          { this{ "Anonymous Thread", cl, 0p, stackSize }; }
 static inline void ?{}(thread_desc & this, struct cluster & cl, void * storage, size_t storageSize )        { this{ "Anonymous Thread", cl, storage, storageSize }; }
-static inline void ?{}(thread_desc & this, const char * const name)                                         { this{ name, *mainCluster, NULL, 65000 }; }
-static inline void ?{}(thread_desc & this, const char * const name, struct cluster & cl )                   { this{ name, cl, NULL, 65000 }; }
-static inline void ?{}(thread_desc & this, const char * const name, struct cluster & cl, size_t stackSize ) { this{ name, cl, NULL, stackSize }; }
+static inline void ?{}(thread_desc & this, const char * const name)                                         { this{ name, *mainCluster, 0p, 65000 }; }
+static inline void ?{}(thread_desc & this, const char * const name, struct cluster & cl )                   { this{ name, cl, 0p, 65000 }; }
+static inline void ?{}(thread_desc & this, const char * const name, struct cluster & cl, size_t stackSize ) { this{ name, cl, 0p, stackSize }; }
 
 //-----------------------------------------------------------------------------
Index: libcfa/src/fstream.cfa
===================================================================
--- libcfa/src/fstream.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/fstream.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Sep 10 22:19:56 2019
-// Update Count     : 354
+// Last Modified On : Fri Nov 29 06:56:46 2019
+// Update Count     : 355
 //
 
@@ -66,4 +66,8 @@
 } // ?{}
 
+void ^?{}( ofstream & os ) {
+	close( os );
+} // ^?{}
+
 void sepOn( ofstream & os ) { os.sepOnOff = ! getNL( os ); }
 void sepOff( ofstream & os ) { os.sepOnOff = false; }
@@ -195,4 +199,8 @@
 } // ?{}
 
+void ^?{}( ifstream & is ) {
+	close( is );
+} // ^?{}
+
 void nlOn( ifstream & os ) { os.nlOnOff = true; }
 void nlOff( ifstream & os ) { os.nlOnOff = false; }
Index: libcfa/src/fstream.hfa
===================================================================
--- libcfa/src/fstream.hfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/fstream.hfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jul 15 18:10:23 2019
-// Update Count     : 167
+// Last Modified On : Fri Nov 29 06:56:02 2019
+// Update Count     : 168
 //
 
@@ -72,4 +72,5 @@
 void ?{}( ofstream & os, const char * name, const char * mode );
 void ?{}( ofstream & os, const char * name );
+void ^?{}( ofstream & os );
 
 extern ofstream & sout, & stdout, & serr, & stderr;		// aliases
@@ -101,4 +102,5 @@
 void ?{}( ifstream & is, const char * name, const char * mode );
 void ?{}( ifstream & is, const char * name );
+void ^?{}( ifstream & is );
 
 extern ifstream & sin, & stdin;							// aliases
Index: libcfa/src/heap.cfa
===================================================================
--- libcfa/src/heap.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/heap.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Tue Dec 19 21:58:35 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sun Nov 24 17:56:15 2019
-// Update Count     : 638
+// Last Modified On : Wed Dec  4 21:42:46 2019
+// Update Count     : 646
 //
 
@@ -35,7 +35,5 @@
 static bool traceHeap = false;
 
-inline bool traceHeap() {
-	return traceHeap;
-} // traceHeap
+inline bool traceHeap() { return traceHeap; }
 
 bool traceHeapOn() {
@@ -51,4 +49,6 @@
 } // traceHeapOff
 
+bool traceHeapTerm() { return false; }
+
 
 static bool prtFree = false;
@@ -71,23 +71,4 @@
 
 
-// static bool traceHeapTerm = false;
-
-// inline bool traceHeapTerm() {
-// 	return traceHeapTerm;
-// } // traceHeapTerm
-
-// bool traceHeapTermOn() {
-// 	bool temp = traceHeapTerm;
-// 	traceHeapTerm = true;
-// 	return temp;
-// } // traceHeapTermOn
-
-// bool traceHeapTermOff() {
-// 	bool temp = traceHeapTerm;
-// 	traceHeapTerm = false;
-// 	return temp;
-// } // traceHeapTermOff
-
-
 enum {
 	// Define the default extension heap amount in units of bytes. When the uC++ supplied heap reaches the brk address,
@@ -115,9 +96,9 @@
 	if ( allocFree != 0 ) {
 		// DO NOT USE STREAMS AS THEY MAY BE UNAVAILABLE AT THIS POINT.
-		// char helpText[512];
-		// int len = snprintf( helpText, sizeof(helpText), "CFA warning (UNIX pid:%ld) : program terminating with %u(0x%x) bytes of storage allocated but not freed.\n"
-		// 					"Possible cause is unfreed storage allocated by the program or system/library routines called from the program.\n",
-		// 					(long int)getpid(), allocFree, allocFree ); // always print the UNIX pid
-		// __cfaabi_dbg_bits_write( STDERR_FILENO, helpText, len ); // print debug/nodebug
+		char helpText[512];
+		int len = snprintf( helpText, sizeof(helpText), "CFA warning (UNIX pid:%ld) : program terminating with %u(0x%x) bytes of storage allocated but not freed.\n"
+							"Possible cause is unfreed storage allocated by the program or system/library routines called from the program.\n",
+							(long int)getpid(), allocFree, allocFree ); // always print the UNIX pid
+		__cfaabi_bits_write( STDERR_FILENO, helpText, len ); // print debug/nodebug
 	} // if
 } // prtUnfreed
@@ -713,8 +694,8 @@
 static void ^?{}( HeapManager & ) {
 	#ifdef __STATISTICS__
-	// if ( traceHeapTerm() ) {
-	// 	printStats();
-	// 	if ( prtfree() ) prtFree( heapManager, true );
-	// } // if
+	if ( traceHeapTerm() ) {
+		printStats();
+		// if ( prtfree() ) prtFree( heapManager, true );
+	} // if
 	#endif // __STATISTICS__
 } // ~HeapManager
@@ -874,5 +855,6 @@
 		#endif // __STATISTICS__
 
-	  if ( unlikely( size == 0 ) ) { free( oaddr ); return 0p; } // special cases
+		// If size is equal to 0, either NULL or a pointer suitable to be passed to free() is returned.
+	  if ( unlikely( size == 0 ) ) { free( oaddr ); return mallocNoStats( size ); } // special cases
 	  if ( unlikely( oaddr == 0p ) ) return mallocNoStats( size );
 
@@ -1101,5 +1083,6 @@
 	#endif // __STATISTICS__
 
-  if ( unlikely( size == 0 ) ) { free( oaddr ); return 0p; } // special cases
+	// If size is equal to 0, either NULL or a pointer suitable to be passed to free() is returned.
+  if ( unlikely( size == 0 ) ) { free( oaddr ); return mallocNoStats( size ); } // special cases
   if ( unlikely( oaddr == 0p ) ) return mallocNoStats( size );
 
Index: libcfa/src/interpose.cfa
===================================================================
--- libcfa/src/interpose.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/interpose.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Wed Mar 29 16:10:31 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Nov 21 16:47:02 2019
-// Update Count     : 118
+// Last Modified On : Sat Nov 30 07:09:42 2019
+// Update Count     : 119
 //
 
@@ -196,6 +196,6 @@
 	__cfaabi_bits_print_nolock( STDERR_FILENO, "Stack back trace for: %s\n", messages[0]);
 
-	for ( int i = Start; i < size - abort_lastframe && messages != NULL; i += 1 ) {
-		char * name = NULL, * offset_begin = NULL, * offset_end = NULL;
+	for ( int i = Start; i < size - abort_lastframe && messages != 0p; i += 1 ) {
+		char * name = 0p, * offset_begin = 0p, * offset_end = 0p;
 
 		for ( char * p = messages[i]; *p; ++p ) {
Index: libcfa/src/startup.cfa
===================================================================
--- libcfa/src/startup.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/startup.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,15 +10,15 @@
 // Created On       : Tue Jul 24 16:21:57 2018
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Jul 25 16:42:01 2018
-// Update Count     : 11
+// Last Modified On : Sat Nov 30 07:07:56 2019
+// Update Count     : 13
 //
 
 #include "startup.hfa"
-#include <unistd.h>
-
+#include <time.h>										// tzset
 
 extern "C" {
     static void __cfaabi_appready_startup( void ) __attribute__(( constructor( STARTUP_PRIORITY_APPREADY ) ));
     void __cfaabi_appready_startup( void ) {
+		tzset();										// initialize time global variables
 		#ifdef __CFA_DEBUG__
 		extern void heapAppStart();
Index: libcfa/src/stdlib.hfa
===================================================================
--- libcfa/src/stdlib.hfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/stdlib.hfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Thu Jan 28 17:12:35 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Nov 22 15:13:14 2019
-// Update Count     : 399
+// Last Modified On : Fri Nov 29 23:08:02 2019
+// Update Count     : 400
 //
 
@@ -210,18 +210,18 @@
 
 static inline {
-	int ato( const char * sptr ) { return (int)strtol( sptr, 0, 10 ); }
-	unsigned int ato( const char * sptr ) { return (unsigned int)strtoul( sptr, 0, 10 ); }
-	long int ato( const char * sptr ) { return strtol( sptr, 0, 10 ); }
-	unsigned long int ato( const char * sptr ) { return strtoul( sptr, 0, 10 ); }
-	long long int ato( const char * sptr ) { return strtoll( sptr, 0, 10 ); }
-	unsigned long long int ato( const char * sptr ) { return strtoull( sptr, 0, 10 ); }
-
-	float ato( const char * sptr ) { return strtof( sptr, 0 ); }
-	double ato( const char * sptr ) { return strtod( sptr, 0 ); }
-	long double ato( const char * sptr ) { return strtold( sptr, 0 ); }
-
-	float _Complex ato( const char * sptr ) { return strto( sptr, NULL ); }
-	double _Complex ato( const char * sptr ) { return strto( sptr, NULL ); }
-	long double _Complex ato( const char * sptr ) { return strto( sptr, NULL ); }
+	int ato( const char * sptr ) { return (int)strtol( sptr, 0p, 10 ); }
+	unsigned int ato( const char * sptr ) { return (unsigned int)strtoul( sptr, 0p, 10 ); }
+	long int ato( const char * sptr ) { return strtol( sptr, 0p, 10 ); }
+	unsigned long int ato( const char * sptr ) { return strtoul( sptr, 0p, 10 ); }
+	long long int ato( const char * sptr ) { return strtoll( sptr, 0p, 10 ); }
+	unsigned long long int ato( const char * sptr ) { return strtoull( sptr, 0p, 10 ); }
+
+	float ato( const char * sptr ) { return strtof( sptr, 0p ); }
+	double ato( const char * sptr ) { return strtod( sptr, 0p ); }
+	long double ato( const char * sptr ) { return strtold( sptr, 0p ); }
+
+	float _Complex ato( const char * sptr ) { return strto( sptr, 0p ); }
+	double _Complex ato( const char * sptr ) { return strto( sptr, 0p ); }
+	long double _Complex ato( const char * sptr ) { return strto( sptr, 0p ); }
 } // distribution
 
Index: longrun_tests/Makefile.in
===================================================================
--- longrun_tests/Makefile.in	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ longrun_tests/Makefile.in	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -486,6 +486,5 @@
 LTCFACOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=compile $(CFACC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFAFLAGS) $(CFAFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFAFLAGS) $(AM_CFLAGS) $(CFAFLAGS) $(CFLAGS)
 
 AM_V_CFA = $(am__v_CFA_@AM_V@)
Index: src/Concurrency/Keywords.cc
===================================================================
--- src/Concurrency/Keywords.cc	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ src/Concurrency/Keywords.cc	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -309,15 +309,8 @@
 			if( !type_decl ) SemanticError( cast, context_error );
 			if( !dtor_decl ) SemanticError( cast, context_error );
-			Expression * arg = cast->arg;
-			cast->arg = nullptr;
-			delete cast;
-			return new CastExpr(
-				UntypedExpr::createDeref(
-					new UntypedExpr( new NameExpr( getter_name ), { arg } )
-				),
-				new ReferenceType(
-					noQualifiers,
-					new StructInstType( noQualifiers, type_decl ) )
-				);
+			assert( cast->result == nullptr );
+			cast->set_result( new ReferenceType( noQualifiers, new StructInstType( noQualifiers, type_decl ) ) );
+			cast->concrete_target.field  = field_name;
+			cast->concrete_target.getter = getter_name;
 		}
 		return cast;
Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ src/Parser/parser.yy	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Sat Sep  1 20:22:55 2001
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sun Aug  4 21:48:23 2019
-// Update Count     : 4364
+// Last Modified On : Sat Dec  7 10:43:44 2019
+// Update Count     : 4394
 //
 
@@ -211,4 +211,15 @@
 } // forCtrl
 
+KeywordCastExpr::Target Aggregate2Target( DeclarationNode::Aggregate aggr ) {
+	KeywordCastExpr::Target target;
+	switch ( aggr ) {
+	  case DeclarationNode::Coroutine: target = KeywordCastExpr::Coroutine; break;
+	  case DeclarationNode::Monitor: target = KeywordCastExpr::Monitor; break;
+	  case DeclarationNode::Thread: target = KeywordCastExpr::Thread; break;
+	  default: abort();
+	} // switch
+	return target;
+} // Aggregate2Target
+
 
 bool forall = false, yyy = false;						// aggregate have one or more forall qualifiers ?
@@ -365,5 +376,5 @@
 %type<decl> abstract_parameter_declaration
 
-%type<aggKey> aggregate_key
+%type<aggKey> aggregate_key aggregate_data aggregate_control
 %type<decl> aggregate_type aggregate_type_nobody
 
@@ -650,4 +661,6 @@
 	| postfix_expression '.' '[' field_name_list ']'	// CFA, tuple field selector
 		{ $$ = new ExpressionNode( build_fieldSel( $1, build_tuple( $4 ) ) ); }
+	| postfix_expression '.' aggregate_control
+		{ $$ = new ExpressionNode( build_keyword_cast( Aggregate2Target( $3 ), $1 ) ); }
 	| postfix_expression ARROW identifier
 		{ $$ = new ExpressionNode( build_pfieldSel( $1, build_varref( $3 ) ) ); }
@@ -793,13 +806,6 @@
 	| '(' type_no_function ')' cast_expression
 		{ $$ = new ExpressionNode( build_cast( $2, $4 ) ); }
-		// keyword cast cannot be grouped because of reduction in aggregate_key
-	| '(' GENERATOR '&' ')' cast_expression				// CFA
-		{ $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Coroutine, $5 ) ); }
-	| '(' COROUTINE '&' ')' cast_expression				// CFA
-		{ $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Coroutine, $5 ) ); }
-	| '(' THREAD '&' ')' cast_expression				// CFA
-		{ $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Thread, $5 ) ); }
-	| '(' MONITOR '&' ')' cast_expression				// CFA
-		{ $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Monitor, $5 ) ); }
+	| '(' aggregate_control '&' ')' cast_expression		// CFA
+		{ $$ = new ExpressionNode( build_keyword_cast( Aggregate2Target( $2 ), $5 ) ); }
 		// VIRTUAL cannot be opt because of look ahead issues
 	| '(' VIRTUAL ')' cast_expression					// CFA
@@ -2059,11 +2065,19 @@
 
 aggregate_key:
+	aggregate_data
+	| aggregate_control
+	;
+
+aggregate_data:
 	STRUCT
 		{ yyy = true; $$ = DeclarationNode::Struct; }
 	| UNION
 		{ yyy = true; $$ = DeclarationNode::Union; }
-	| EXCEPTION
+	| EXCEPTION											// CFA
 		{ yyy = true; $$ = DeclarationNode::Exception; }
-	| GENERATOR
+	;
+
+aggregate_control:										// CFA
+	GENERATOR
 		{ yyy = true; $$ = DeclarationNode::Coroutine; }
 	| COROUTINE
@@ -2096,4 +2110,6 @@
 			distInl( $3 );
 		}
+	| INLINE aggregate_control ';'						// CFA
+	   	{ SemanticError( yylloc, "INLINE aggregate control currently unimplemented." ); $$ = nullptr; }
 	| typedef_declaration ';'							// CFA
 	| cfa_field_declaring_list ';'						// CFA, new style field declaration
Index: src/ResolvExpr/AlternativeFinder.cc
===================================================================
--- src/ResolvExpr/AlternativeFinder.cc	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ src/ResolvExpr/AlternativeFinder.cc	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -69,4 +69,5 @@
 		void postvisit( CastExpr * castExpr );
 		void postvisit( VirtualCastExpr * castExpr );
+		void postvisit( KeywordCastExpr * castExpr );
 		void postvisit( UntypedMemberExpr * memberExpr );
 		void postvisit( MemberExpr * memberExpr );
@@ -1255,4 +1256,61 @@
 	}
 
+	void AlternativeFinder::Finder::postvisit( KeywordCastExpr * castExpr ) {
+		assertf( castExpr->get_result(), "Cast target should have been set in Validate." );
+		auto ref = dynamic_cast<ReferenceType*>(castExpr->get_result());
+		assert(ref);
+		auto inst = dynamic_cast<StructInstType*>(ref->base);
+		assert(inst);
+		auto target = inst->baseStruct;
+
+		AlternativeFinder finder( indexer, env );
+
+		auto pick_alternatives = [target, this](AltList & found, bool expect_ref) {
+			for(auto & alt : found) {
+				Type * expr = alt.expr->get_result();
+				if(expect_ref) {
+					auto res = dynamic_cast<ReferenceType*>(expr);
+					if(!res) { continue; }
+					expr = res->base;
+				}
+
+				if(auto insttype = dynamic_cast<TypeInstType*>(expr)) {
+					auto td = alt.env.lookup(insttype->name);
+					if(!td) { continue; }
+					expr = td->type;
+				}
+
+				if(auto base = dynamic_cast<StructInstType*>(expr)) {
+					if(base->baseStruct == target) {
+						alternatives.push_back(
+							std::move(alt)
+						);
+					}
+				}
+			}
+		};
+
+		try {
+			// Attempt 1 : turn (thread&)X into (thread_desc&)X.__thrd
+			// Clone is purely for memory management
+			std::unique_ptr<Expression> tech1 { new UntypedMemberExpr(new NameExpr(castExpr->concrete_target.field), castExpr->arg->clone()) };
+
+			// don't prune here, since it's guaranteed all alternatives will have the same type
+			finder.findWithoutPrune( tech1.get() );
+			pick_alternatives(finder.alternatives, false);
+
+			return;
+		} catch(SemanticErrorException & ) {}
+
+		// Fallback : turn (thread&)X into (thread_desc&)get_thread(X)
+		std::unique_ptr<Expression> fallback { UntypedExpr::createDeref( new UntypedExpr(new NameExpr(castExpr->concrete_target.getter), { castExpr->arg->clone() })) };
+		// don't prune here, since it's guaranteed all alternatives will have the same type
+		finder.findWithoutPrune( fallback.get() );
+
+		pick_alternatives(finder.alternatives, true);
+
+		// Whatever happens here, we have no more fallbacks
+	}
+
 	namespace {
 		/// Gets name from untyped member expression (member must be NameExpr)
Index: src/SynTree/Expression.h
===================================================================
--- src/SynTree/Expression.h	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ src/SynTree/Expression.h	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -231,5 +231,11 @@
 	enum Target {
 		Coroutine, Thread, Monitor, NUMBER_OF_TARGETS
-	} target;
+	};
+	struct Concrete {
+		std::string field;
+		std::string getter;
+	};
+	Target target;
+	Concrete concrete_target;
 
 	KeywordCastExpr( Expression * arg, Target target );
Index: src/cfa.make
===================================================================
--- src/cfa.make	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ src/cfa.make	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -4,6 +4,5 @@
 LTCFACOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=compile $(CFACC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFAFLAGS) $(CFAFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFAFLAGS) $(AM_CFLAGS) $(CFAFLAGS) $(CFLAGS)
 
 AM_V_CFA = $(am__v_CFA_@AM_V@)
Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ tests/Makefile.am	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -46,5 +46,5 @@
 
 # adjust CC to current flags
-CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH),$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
+CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
 CFACC = $(CC)
 
@@ -53,5 +53,5 @@
 
 # adjusted CC but without the actual distcc call
-CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH),$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
+CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
 
 PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
Index: tests/Makefile.in
===================================================================
--- tests/Makefile.in	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ tests/Makefile.in	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -214,5 +214,5 @@
 
 # adjust CC to current flags
-CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH),$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
+CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
 CCAS = @CCAS@
 CCASDEPMODE = @CCASDEPMODE@
@@ -358,6 +358,5 @@
 LTCFACOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=compile $(CFACC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFAFLAGS) $(CFAFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFAFLAGS) $(AM_CFLAGS) $(CFAFLAGS) $(CFLAGS)
 
 AM_V_CFA = $(am__v_CFA_@AM_V@)
@@ -405,5 +404,5 @@
 
 # adjusted CC but without the actual distcc call
-CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH),$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
+CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
 PRETTY_PATH = mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
 avl_test_SOURCES = avltree/avl_test.cfa avltree/avl0.cfa avltree/avl1.cfa avltree/avl2.cfa avltree/avl3.cfa avltree/avl4.cfa avltree/avl-private.cfa
Index: tests/concurrent/thread.cfa
===================================================================
--- tests/concurrent/thread.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ tests/concurrent/thread.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -7,6 +7,6 @@
 thread Second { semaphore* lock; };
 
-void ?{}( First  & this, semaphore & lock ) { ((thread&)this){"Thread 1"}; this.lock = &lock; }
-void ?{}( Second & this, semaphore & lock ) { ((thread&)this){"Thread 2"}; this.lock = &lock; }
+void ?{}( First  & this, semaphore & lock ) { ((thread&)this){ "Thread 1" }; this.lock = &lock; }
+void ?{}( Second & this, semaphore & lock ) { ((thread&)this){ "Thread 2" }; this.lock = &lock; }
 
 void main(First& this) {
Index: tests/linking/withthreads.cfa
===================================================================
--- tests/linking/withthreads.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ tests/linking/withthreads.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -34,4 +34,4 @@
 // Local Variables: //
 // tab-width: 4 //
-// compile-command: "cfa nothreads.cfa" //
+// compile-command: "cfa withthreads.cfa" //
 // End: //
Index: tests/references.cfa
===================================================================
--- tests/references.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ tests/references.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -124,6 +124,6 @@
 		int *p = &a;
 		asm (
-			"incl %[p]\n\t" :
-			: [p] "m" (*p)
+			"incl %[p]\n\t"
+			: [p] "+m" (*p)
 		);
 		printf("%d\n", a);
Index: tests/time.cfa
===================================================================
--- tests/time.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ tests/time.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Tue Mar 27 17:24:56 2018
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Dec 20 23:09:21 2018
-// Update Count     : 23
+// Last Modified On : Fri Nov 29 23:05:30 2019
+// Update Count     : 24
 //
 
@@ -20,5 +20,4 @@
 	Duration d1 = 3`h, d2 = 2`s, d3 = 3.375`s, d4 = 12`s, d5 = 1`s + 10_000`ns;
 	sout | d1 | d2 | d3 | d4 | d5;
-	int i;
 	d1 = 0;
 	sout | d1 | d2 | d3;
