From: Pavel Pisa Date: Sun, 20 Jan 2013 14:25:04 +0000 (+0100) Subject: Fix compilation on GCC 4.7 for ARM ABI. X-Git-Tag: ul_drv-1.0.0-release~1 X-Git-Url: https://rtime.felk.cvut.cz/gitweb/ulut.git/commitdiff_plain/98c4b4847c9272521fcb12ccd10961d0837a2233 Fix compilation on GCC 4.7 for ARM ABI. Use va_start to initialize empty va_list properly. The solution has quite high overhead but other future proof portable solution has not been found. Problem was found and initial workaround has been provided by Martin Meloun. Signed-off-by: Pavel Pisa --- diff --git a/ulut/ul_evcbase.c b/ulut/ul_evcbase.c index d3884b9..d2319cd 100644 --- a/ulut/ul_evcbase.c +++ b/ulut/ul_evcbase.c @@ -212,6 +212,19 @@ int evc_link_delete(evc_link_t *link) return res; } +/* Local function to make initialization of empty va_list portable */ +static inline +int evc_link_propagate_dead(evc_link_t *link, ...) +{ + va_list no_args; + int res; + + va_start(no_args, link); + res=link->propagate(link,no_args); + va_end(no_args); + return res; +} + /** * evc_link_dispose - Disposes Link * @link: pointer to the possibly connected initialized link @@ -223,7 +236,7 @@ void evc_link_dispose(evc_link_t *link) { if(!link->dead){ link->dead=1; - if(!link->propagate(link,0)){ + if(!evc_link_propagate_dead(link)) { evc_link_inc_refcnt(link); evc_link_delete(link); if(link->malloced) free(link);