libffcall
[Top][All Lists]
Advanced

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

Re: Does va_return_type automatically returns?


From: Bruno Haible
Subject: Re: Does va_return_type automatically returns?
Date: Sat, 08 Feb 2020 19:53:16 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-171-generic; KDE/5.18.0; x86_64; ; )

> Does va_return_type automatically returns

No, it only finishes the setup of the return value for when the
function returns.

You can have additional statements after the va_return_... invocation,
but they cannot influence the return value any more.

> 
>     void func(...) {
>         va_start ...
> 
>         if (cond)
>             va_return ...
>     }
> 
> 
> or this?
> 
>     void func(...) {
>         va_start ...
> 
>         if (cond) {
>             va_return ...
>             return;
>         }
>     }

Here the 'return;' statement is redundant, since at that point the
function would return anyway.

Bruno




reply via email to

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