Index: trunk/src/cutest_sh_unix.c
===================================================================
--- trunk/src/cutest_sh_unix.c	(revision 473)
+++ trunk/src/cutest_sh_unix.c	(revision 474)
@@ -42,5 +42,7 @@
       CuAssertPtrNotNull(tc, buf);
 #ifndef USE_SYSTEM_MALLOC
+#ifndef __clang__
       CuAssertIntEquals (tc, malloc_count, (i_malloc + 1));
+#endif
 #endif
       free(buf);
Index: trunk/src/sh_err_console.c
===================================================================
--- trunk/src/sh_err_console.c	(revision 473)
+++ trunk/src/sh_err_console.c	(revision 474)
@@ -328,5 +328,5 @@
   /* --- daemon && initialized ---
    */
-  if ( (OnlyStderr == S_FALSE) ) 
+  if ( OnlyStderr == S_FALSE ) 
     {
       fd[0] = open ( sh.srvcons.name, O_WRONLY|O_APPEND|O_NOCTTY|O_NONBLOCK);
@@ -340,5 +340,5 @@
       }
 
-      if (sh.srvcons.alt != NULL && sh.srvcons.alt[0] != '\0')
+      if (sh.srvcons.alt[0] != '\0')
 	{
 	  fd[1] = open (sh.srvcons.alt, O_WRONLY|O_APPEND|O_NOCTTY|O_NONBLOCK);
Index: trunk/src/sh_gpg.c
===================================================================
--- trunk/src/sh_gpg.c	(revision 473)
+++ trunk/src/sh_gpg.c	(revision 474)
@@ -419,16 +419,9 @@
   /* use homedir of effective user
    */
-  if (sh.effective.home != NULL)
-    {
-      len = sl_strlen(sh.effective.home) + 6;
-      envp[0] = calloc(1, len); /* free() ok   */
-      if (envp[0] != NULL)
+  len = sl_strlen(sh.effective.home) + 6;
+  envp[0] = calloc(1, len); /* free() ok   */
+  if (envp[0] != NULL)
 	sl_snprintf (envp[0], len, _("HOME=%s"), sh.effective.home); 
-      envp[1] = NULL;
-    }
-  else
-    {
-      envp[0] = NULL;
-    }
+  envp[1] = NULL;
 
   /* Create the pipe 
Index: trunk/src/sh_hash.c
===================================================================
--- trunk/src/sh_hash.c	(revision 473)
+++ trunk/src/sh_hash.c	(revision 474)
@@ -1751,5 +1751,5 @@
     }
 	 
-  if (buf != NULL && buf->fullpath != NULL) {
+  if (buf != NULL) {
 
     old_len = sl_strlen(buf->fullpath);
@@ -3099,5 +3099,5 @@
 	theFile->fullpath, fileHash, p->theFile.checksum));
 
-  if ( (fileHash != NULL) && (p->theFile.checksum != NULL)   && 
+  if ( (fileHash != NULL) &&
        (strncmp (fileHash, p->theFile.checksum, KEY_LEN) != 0) && 
        (theFile->check_mask & MODI_CHK) != 0)
Index: trunk/src/sh_inotify.c
===================================================================
--- trunk/src/sh_inotify.c	(revision 473)
+++ trunk/src/sh_inotify.c	(revision 474)
@@ -22,5 +22,5 @@
 #if defined(HAVE_SYS_INOTIFY_H)
 
-#if defined(GCC_VERSION_MAJOR)
+#if defined(GCC_VERSION_MAJOR) && !defined(__clang__)
 #if (GCC_VERSION_MAJOR > 4) || ((GCC_VERSION_MAJOR == 4) && (GCC_VERSION_MINOR > 8))
 #pragma GCC diagnostic ignored "-Wclobbered"
Index: trunk/src/sh_nmail.c
===================================================================
--- trunk/src/sh_nmail.c	(revision 473)
+++ trunk/src/sh_nmail.c	(revision 474)
@@ -24,5 +24,5 @@
 #endif
 
-#if defined(GCC_VERSION_MAJOR)
+#if defined(GCC_VERSION_MAJOR) && !defined(__clang__)
 #if (GCC_VERSION_MAJOR > 4) || ((GCC_VERSION_MAJOR == 4) && (GCC_VERSION_MINOR > 8))
 #pragma GCC diagnostic ignored "-Wclobbered"
Index: trunk/src/sh_srp.c
===================================================================
--- trunk/src/sh_srp.c	(revision 473)
+++ trunk/src/sh_srp.c	(revision 474)
@@ -86,5 +86,5 @@
 int    siz_str_internal = 0;
 
-inline
+static
 char * big_string (bignum * a, int base)
 {
Index: trunk/src/sh_suidchk.c
===================================================================
--- trunk/src/sh_suidchk.c	(revision 473)
+++ trunk/src/sh_suidchk.c	(revision 474)
@@ -203,5 +203,5 @@
   ShSuidchkSeverity = SH_ERR_SEVERE;
   if (ShSuidchkExclude != NULL)
-    sh_suid_exclude_free(ShSuidchkExclude);
+    sh_suid_exclude_free();
 
   FileLimNow        = 0;
Index: trunk/src/sh_tiger1_64.c
===================================================================
--- trunk/src/sh_tiger1_64.c	(revision 473)
+++ trunk/src/sh_tiger1_64.c	(revision 474)
@@ -5,11 +5,16 @@
 #include "config_xor.h"
 
+#if defined(__clang__)
+#undef TIGER_OPT_ASM
+#endif
+
 #if defined(TIGER_64_BIT)
 
-#if defined(GCC_VERSION_MAJOR)
+#if defined(GCC_VERSION_MAJOR) && !defined(__clang__)
 #if ((GCC_VERSION_MAJOR == 4) && (GCC_VERSION_MINOR > 6))
 #pragma GCC optimize ("O1")
 #endif
 #endif
+
 
 /* #if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64) */
Index: trunk/src/sh_unix.c
===================================================================
--- trunk/src/sh_unix.c	(revision 473)
+++ trunk/src/sh_unix.c	(revision 474)
@@ -972,5 +972,5 @@
 
   SL_ENTER(_("sh_unix_self_check"));
-  if (sh.exec.path == NULL || sh.exec.path[0] == '\0')
+  if (sh.exec.path[0] == '\0')
     SL_RETURN((0), _("sh_unix_self_check"));
 
Index: trunk/src/sh_utmp.c
===================================================================
--- trunk/src/sh_utmp.c	(revision 473)
+++ trunk/src/sh_utmp.c	(revision 474)
@@ -319,9 +319,4 @@
   SL_ENTER(_("sh_utmp_setutent"));
 
-  ASSERT((sh_utmppath != NULL), _("sh_utmppath != NULL"));
-
-  if (sh_utmppath == NULL)
-    SL_RET0(_("sh_utmp_setutent"));
-
   if (sh_utmpfile == NULL) 
     {
Index: trunk/src/trustfile.c
===================================================================
--- trunk/src/trustfile.c	(revision 473)
+++ trunk/src/trustfile.c	(revision 474)
@@ -211,5 +211,5 @@
 #define SL_ALWAYS_TRUSTED  0
 #endif
-static uid_t test_rootonly[] = { SL_ALWAYS_TRUSTED };
+uid_t test_rootonly[] = { SL_ALWAYS_TRUSTED };
 
 #define tf_uid_neg ((uid_t)-1)
Index: trunk/src/zAVLTree.c
===================================================================
--- trunk/src/zAVLTree.c	(revision 473)
+++ trunk/src/zAVLTree.c	(revision 474)
@@ -39,14 +39,28 @@
   return (zAVLKey) arg;
 }
+
 static char * dummy_zfree_string;
+#ifdef __clang__
+static char * dummy_zfree_str;
+#endif
+
 static void zfree_string (void * inptr)
 {
+#ifdef __clang__
+  dummy_zfree_str = (char *) inptr;
+#else
   char * str = (char *) inptr;
+#endif
 
   /* Take the address to circumvent gcc 4.9 optimizer bug */
   dummy_zfree_string = (char *) &inptr;
 
+#ifdef __clang__
+  dummy_zfree_str[0] = '\0';
+  free (dummy_zfree_str);
+#else
   str[0] = '\0';
   free (inptr);
+#endif
   return;
 }
@@ -537,6 +551,8 @@
   if (avlnode->right)
     zAVLFreeBranch(avlnode->right, freeitem);
-  if (freeitem)
+  if (freeitem) {
     freeitem(avlnode->item);
+    avlnode->item = NULL;
+  }
   free(avlnode);
 }
