Peter Jones <pjo...@redhat.com> writes:

> grub_min(a,b) and grub_max(a,b) use a relatively naive implementation
> which leads to several problems:
> - they evaluate their parameters more than once
> - the naive way to address this, to declare temporary variables in a
>   statement-expression, isn't resilient against nested uses, because
>   MIN(a,MIN(b,c)) results in the temporary variables being declared in
>   two nested scopes, which may result in a build warning depending on
>   your build options.
>
> This patch changes our implementation to use a statement-expression
> inside a helper macro, and creates the symbols for the temporary
> variables with __COUNTER__ (A GNU C cpp extension) and token pasting to
> create uniquely named internal variables.
>
> Signed-off-by: Peter Jones <pjo...@redhat.com>

Reviewed-by: Robbie Harwood <rharw...@redhat.com>

Be well,
--Robbie

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to