Index: tests/concurrency/pthread/pthread_attr_test.cfa
===================================================================
--- tests/concurrency/pthread/pthread_attr_test.cfa	(revision 6a6e205dc434bc9868c1018598b6e19e86a80c3b)
+++ tests/concurrency/pthread/pthread_attr_test.cfa	(revision b26ab30d8ba28adf1dccf63a7eac80ff42a90df3)
@@ -4,8 +4,11 @@
 #include <thread.hfa>
 
-void* foo(void* _attr){
+void* foo(void*){
+    pthread_t self = pthread_self();
+    pthread_attr_t self_attr;
+    pthread_getattr_np(self, &self_attr);
+
     size_t size;
-    pthread_attr_t* attr = (pthread_attr_t*)_attr;
-    int status = pthread_attr_getstacksize(attr, &size);
+    int status = pthread_attr_getstacksize(&self_attr, &size);
     if (status != 0){
         sout | "error return code";
@@ -16,5 +19,5 @@
 }
 
-int main(int argc, char const *argv[])
+int main()
 {
     pthread_attr_t attr;
@@ -23,5 +26,5 @@
     pthread_t thr;
     void* res;
-    pthread_create(&thr, &attr, foo, (void*)&attr);
+    pthread_create(&thr, &attr, foo, (void*)0);
     pthread_join(thr, &res);
     pthread_attr_destroy(&attr);
Index: tests/concurrency/pthread/pthread_demo_create_join.cfa
===================================================================
--- tests/concurrency/pthread/pthread_demo_create_join.cfa	(revision 6a6e205dc434bc9868c1018598b6e19e86a80c3b)
+++ tests/concurrency/pthread/pthread_demo_create_join.cfa	(revision b26ab30d8ba28adf1dccf63a7eac80ff42a90df3)
@@ -3,8 +3,8 @@
 /* test pthread create/join/exit */
 
-int arr[20];
+size_t arr[20];
 
 void* fetch(void* idx){
-    int res = arr[(uint64_t)idx];
+    size_t res = arr[(size_t)idx];
     pthread_exit((void*)res);
     sout | "it should not be here";
@@ -19,10 +19,10 @@
 }
 
-int main(int argc, char const *argv[])
+int main()
 {
     pthread_t threads[20];
     arr_init();
     int status;
-    for (int i = 0; i < 20; i++){
+    for (size_t i = 0; i < 20; i++){
         status = pthread_create(&threads[i], NULL, fetch, (void*)i);
         if (status != 0) exit(1);
@@ -30,9 +30,9 @@
     int res = 0;
     for (int i = 0; i < 20; i++){
-        void* _res = NULL;
-        status = pthread_join(threads[i], &_res);
+        void* res_i = NULL;
+        status = pthread_join(threads[i], &res_i);
         if (status != 0) exit(2);
-        if (((uint64_t)_res) != i) exit(3);
-        res += (uint64_t)_res;
+        if (((size_t)res_i) != i) exit(3);
+        res += (size_t)res_i;
     }
     sout | "final res is" | res;
Index: tests/concurrency/pthread/pthread_key_test.cfa
===================================================================
--- tests/concurrency/pthread/pthread_key_test.cfa	(revision 6a6e205dc434bc9868c1018598b6e19e86a80c3b)
+++ tests/concurrency/pthread/pthread_key_test.cfa	(revision b26ab30d8ba28adf1dccf63a7eac80ff42a90df3)
@@ -16,5 +16,6 @@
     #define BUFFSZ  48
     pthread_key_t   key;
-    volatile int total_value,total_value_getspec;
+    volatile size_t total_value;
+    volatile size_t total_value_getspec;
     pthread_mutex_t value_mutex;
 
@@ -26,5 +27,4 @@
         int       *tnum;
         void      *getvalue;
-        char       Buffer[BUFFSZ];
 
         tnum = (int*)parm;
@@ -32,5 +32,5 @@
 
         //printf("Thread %d executing\n", threadnum);
-        value = (void *)(rand()%100);
+        value = (void *)(size_t)(rand()%100);
         status = pthread_setspecific(key, (void *) value);
         if ( status !=  0) {
@@ -40,10 +40,10 @@
         }
         pthread_mutex_lock(&value_mutex);
-        total_value_getspec += (int)value;
-        total_value += (int)pthread_getspecific(key);
+        total_value_getspec += (size_t)value;
+        total_value += (size_t)pthread_getspecific(key);
         pthread_mutex_unlock(&value_mutex);
 
 
-        if (!(value = malloc(sizeof(Buffer))))
+        if (!(value = malloc(BUFFSZ)))
             printf("Thread %d could not allocate storage, errno = %d\n",
                                                         threadnum, errno);
@@ -60,5 +60,5 @@
 
         if (getvalue != value) {
-        printf("getvalue not valid, getvalue=%d", (u_int64_t)getvalue);
+            printf("getvalue not valid, getvalue=%p", getvalue);
             return (void*)68;
         }
@@ -76,5 +76,4 @@
 
     int main() {
-        int          getvalue;
         int          status;
         int          i;
@@ -116,9 +115,9 @@
 
             if (thread_stat[i] != 0)   {
-                printf("bad thread status, thread %d, status=%d\n", i+1,
-                                                        (u_int64_t)thread_stat[i]);
+                printf("bad thread status, thread %d, status=%zd\n", i+1,
+                                                        (size_t)thread_stat[i]);
             }
         }
-        printf("total value is %d, total value by pthread_getspecific is %d\n", total_value, total_value_getspec);
+        printf("total value is %zd, total value by pthread_getspecific is %zd\n", total_value, total_value_getspec);
         exit(0);
     }   // main
