[cfe-dev] Random small issues

Timo Sirainen tss at iki.fi
Sat Oct 18 13:05:02 PDT 2008

I tried compiling Dovecot using clang. The blocker problem was that
va_arg() isn't implemented. Other than that there are a few other small

1. automake's dependency tracking doesn't work with ccc for some reason.
It always recompiles everything. I didn't bother trying to figure out

2. Some small differences with ccc/clang and gcc cause warnings and
compiler errors:

// gcc thinks these types are compatible, clang doesn't
struct foo {
	int x;

int main(void) {
	const struct foo *src;

	if (!__builtin_types_compatible_p(struct foo, typeof(*src)))
	return 0;

// noreturn attribute is useful also for function pointers, but
// clang gives a warning
static void (*fatal)(void) __attribute__((noreturn));

static void __attribute__((noreturn))

int main(void) {
	return 0;

// clang gives a warning, gcc doesn't. I guess gcc figures out that
// a format argument is going in so it should also be coming out.
// That's how I also prefer it (unless there's another way to
// prevent the warning?)
static const char * __attribute__((format_arg(1)))
printf_format_fix(const char *format)
	// maybe modify format
	return format;

int main(void) {
	printf(printf_format_fix("%s"), "hello");
	return 0;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20081018/3cbf2c86/attachment.sig>

More information about the cfe-dev mailing list