On 28/04/2023 18.56, [EXT] Ivan Ribakov wrote:
Hi all,

I looked at Kamailio 5.6.3 makefiles and saw mention of clang being supported. Yet when I try to build it with clang (more precisely, I build a C++ module using clang that includes some Kamailio C headers via "extern C") I get following error:

In file included from /tmp/kamailio/kamailio/modules/tm/t_funcs.h:45:
/tmp/kamailio/kamailio/modules/tm/timer.h:204:2: error: no matching function for call to 'atomic_cmpxchg_int'

Any suggestions on how to overcome this error or any general suggestions for using Kamailio + clang?

That's not a problem of clang, but rather a problem of using C++. C++ doesn't play nice with the void* type and that's what's being used in that inlined function. You'd have the same problem with gcc.

You can either patch up timer.h and change the cast to int* (which it probably should be anyway), or pull in the header in a C source, and then link that from the rest of your C++ project.

Cheers