Messages in this thread | | | From | David Laight <> | Subject | RE: [PATCH v3] kernel.h: Skip single-eval logic on literals in min()/max() | Date | Wed, 14 Mar 2018 11:35:26 +0000 |
| |
From: Kees Cook > Sent: 13 March 2018 22:15 ... > I'll send a "const_max()" which will refuse to work on > non-constant-values (so it doesn't get accidentally used on variables > that could be exposed to double-evaluation), and will work for stack > array declarations (to avoid the overly-sensitive -Wvla checks).
ISTR the definitions were of the form: char foo[max(sizeof (struct bah), sizeof (struct baz))]; This doesn't generate a 'foo' with the required alignment. It would be much better to use a union.
David
| |