Exim successfully builds with clang, albeit with a number of warnings.
* Our %n usage in printf() calls appears to be correct and safe, AFAICT.
* dummy functions are, unsurprisingly, unused
* Valgrind macros cause vociferous complaints
* Dynamic modules *not* tested
Further clang testing on my part will require an OS update and clang
2.9 to get -rdynamic support.
{
off_t test_off_t = 0;
time_t test_time_t = 0;
+#if ! (__STDC_VERSION__ >= 199901L)
size_t test_size_t = 0;
unsigned long test_ulong_t = 0L;
+#endif
long test_long_t = 0;
FILE *base;
FILE *new;
int i;
+/* clang defines __GNUC__ (at least, for me) so test for it first */
+#if defined(__clang__)
+ fprintf(f, "Compiler: CLang [%s]\n", __clang_version__);
+#elif defined(__GNUC__)
+ fprintf(f, "Compiler: GCC [%s]\n",
+# ifdef __VERSION__
+ __VERSION__
+# else
+ "? unknown version ?"
+# endif
+ );
+#else
+ fprintf(f, "Compiler: <unknown>\n");
+#endif
+
#ifdef AUTH_CYRUS_SASL
auth_cyrus_sasl_version_report(f);
#endif
errmsg = errmsg;
do_cache = do_cache;
-switch (wso_query(query, CS buffer, sizeof(buffer)))
+switch (wso_query(CS query, CS buffer, sizeof(buffer)))
{
case 0:
*result = string_copy(buffer); /* IP in database; return name of user */
/* If gcc is being used to compile Exim, we can use its facility for checking
the arguments of printf-like functions. This is done by a macro. */
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__clang__)
#define PRINTF_FUNCTION(A,B) __attribute__((format(printf,A,B)))
#else
#define PRINTF_FUNCTION(A,B)