Peter Jones <[email protected]> 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 <[email protected]>
Reviewed-by: Robbie Harwood <[email protected]> Be well, --Robbie
signature.asc
Description: PGP signature
_______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
