From armgong at yahoo.com  Tue Feb 23 01:56:27 2010
From: armgong at yahoo.com (Gong Yu)
Date: Mon, 22 Feb 2010 16:56:27 -0800 (PST)
Subject: [Rd] patch about compile R with clang
Message-ID: <739921.71704.qm@web45909.mail.sp1.yahoo.com>

clang is compiler http://clang.llvm.org, it is fast and better c compiler then gcc, yesterday i use clang and gfortran compile R.
The only two change in source code is :

1. the configure file (in confiure when test include wctype.h,gcc can compile but clang need include both wchar.h wctype.h),so this is patch
--- /r/configure
+++ /myr/configure
@@ -39172,6 +39172,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+#include <wchar.h>
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
@@ -39480,6 +39481,7 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <wchar.h>
 #include <wctype.h>
 
 #ifdef F77_DUMMY_MAIN


2. edit tre-match-approx.c
change the following line 
#define __USE_STRING_INLINES
#undef __NO_INLINE__
to 
//#define __USE_STRING_INLINES
//#undef __NO_INLINE__
becasue clang will report errors(fields must have a constant size:'variable length array in structure' extension will never be supported' in string.h)



[Rd] patch about compile R with clang
Gong Yu