libjit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libjit] Compiler warning in jit_function_apply_vararg


From: Aleksey Demakov
Subject: Re: [Libjit] Compiler warning in jit_function_apply_vararg
Date: Thu, 16 Aug 2018 03:11:29 +0300

I gather on_demand_driver() should set func->entry_point and
func->is_compiled. I agree that this code looks weird but it's not as
fatally broken as it seems on the first glance. I'll fix the warning
though.

Regards,
Aleksey
On Wed, Aug 15, 2018 at 6:17 PM Eli Zaretskii <address@hidden> wrote:
>
> Compiling jit-function.c produces the following warning:
>
>      libtool: compile:  gcc -static-libgcc -DHAVE_CONFIG_H -I. -I.. 
> -I../include -I../include -I. -I. -fno-gcse -g -O2 -Wall 
> -fno-omit-frame-pointer -MT jit-function.lo -MD -MP -MF 
> .deps/jit-function.Tpo -c jit-function.c  -DDLL_EXPORT -DPIC -o 
> .libs/jit-function.o
>      jit-function.c: In function 'jit_function_apply_vararg':
>      jit-function.c:903:8: warning: variable 'entry' set but not used 
> [-Wunused-but-set-variable]
>        void *entry;
>              ^~~~~
>
> Looking at the code, I see that it computes 'entry', but then uses
> func->entry_point:
>
>         if(func->is_compiled)
>         {
>                 entry = func->entry_point;
>         }
>         else
>         {
>                 entry = (*func->context->on_demand_driver)(func);
>         }
>         [...]
>         /* Apply the function.  If it returns, then there is no exception */
>         jit_apply(signature, func->entry_point, args,
>                           jit_type_num_params(func->signature), return_area);
>
> Should the call to jit_apply use 'entry' instead?
>
> Thanks.
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]