cc -I. -Igsm/inc -Iportaudio/pa_common -Iportaudio/pablio -Iportmixer/px_common -Ilibspeex/include -g -O2 -DLIBVER='"CVS-2006/02/21-16:11"' -DSPEEX_PREPROCESS=1 -DNEWJB -DCODEC_ILBC -Ilibiax2/src -DLIBIAX -DSPEEX_EC=1 -DLINUX -c -o iaxclient_lib.o iaxclient_lib.c iaxclient_lib.c:52: error: static declaration of ‘iaxc_lock’ follows non-static declaration iaxclient_lib.h:203: error: previous declaration of ‘iaxc_lock’ was here iaxclient_lib.c:85: error: static declaration of ‘iaxc_event_callback’ follows non-static declaration iaxclient_lib.h:202: error: previous declaration of ‘iaxc_event_callback’ was here iaxclient_lib.c: In function ‘iaxc_post_event’: iaxclient_lib.c:187: warning: incompatible implicit declaration of built-in function ‘memcpy’ iaxclient_lib.c: In function ‘iaxc_do_state_callback’: iaxclient_lib.c:250: warning: incompatible implicit declaration of built-in function ‘strncpy’ iaxclient_lib.c: In function ‘iaxc_initialize’: iaxclient_lib.c:402: warning: incompatible implicit declaration of built-in function ‘strncpy’ iaxclient_lib.c: In function ‘iaxc_set_callerid’: iaxclient_lib.c:456: warning: incompatible implicit declaration of built-in function ‘strncpy’ iaxclient_lib.c: In function ‘handle_text_event’: iaxclient_lib.c:676: warning: incompatible implicit declaration of built-in function ‘strncpy’ iaxclient_lib.c:676: warning: pointer targets in passing argument 2 of ‘strncpy’ differ in signedness iaxclient_lib.c: In function ‘handle_url_event’: iaxclient_lib.c:688: warning: incompatible implicit declaration of built-in function ‘strcpy’ iaxclient_lib.c:698: warning: incompatible implicit declaration of built-in function ‘strncpy’ iaxclient_lib.c:698: warning: pointer targets in passing argument 2 of ‘strncpy’ differ in signedness iaxclient_lib.c: In function ‘iaxc_register’: iaxclient_lib.c:865: warning: incompatible implicit declaration of built-in function ‘strncpy’ iaxclient_lib.c: In function ‘iaxc_call’: iaxclient_lib.c:884: warning: incompatible implicit declaration of built-in function ‘strstr’ iaxclient_lib.c:918: warning: incompatible implicit declaration of built-in function ‘strncpy’ iaxclient_lib.c:921: warning: incompatible implicit declaration of built-in function ‘strncpy’ iaxclient_lib.c:925: warning: incompatible implicit declaration of built-in function ‘strncpy’ iaxclient_lib.c: In function ‘iaxc_service_network’: iaxclient_lib.c:1134: warning: incompatible implicit declaration of built-in function ‘strncpy’ iaxclient_lib.c: In function ‘iaxc_version’: iaxclient_lib.c:1257: warning: incompatible implicit declaration of built-in function ‘strncpy’ make: *** [iaxclient_lib.o] Error 1 patch is really easy: change extern to static in iaxclient_lib.h (lines 202-203) static iaxc_event_callback_t iaxc_event_callback; static MUTEX iaxc_lock;
Created attachment 80366 [details, diff] kiax-0.8.4-gcc4.patch Patrizio's idea works for me. Patrizio: don't forget to send it to upstream :-).
i hate upstream! :) please mark this as fixed when applying to portage
I doubt that's a fix... that will create different copies of it in different units, one detached from the other.
are u sure it's not the opposite?
Sure. With extern in the header file, and a declaration without static in a unit file, the compiler will emit the variable as local to that unit file and as an extern for all the other unit files, and will resolve it to the local one while linking the objects together. With static, it generates a local static (that cannot be linked against from other units) variable every time it finds the first declaration of the static variable.
Created attachment 83776 [details, diff] gcc4 patch The variables aren't used anywhere else in the code that I see, so we don't even need to declare them in that header, and just let the two static definitions stay. Also, it looks like this is what upstream did for their next version. (you may want to just bump the ebuild to 0.8.5, but this will make it work for 0.8.4, so it is less work :)
ok, works for me. close when applied to portage.
thanks, fixed