Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 27 Mar 2018 07:47:48 +0200
From: Ingo Molnar <>
To: Kees Cook <>
Cc: Andrew Morton <>,
	Linus Torvalds <>,
	Martin Uecker <>,
	Josh Poimboeuf <>,
	Rasmus Villemoes <>,
	Randy Dunlap <>,
	Miguel Ojeda <>,
	David Laight <>,
	Ian Abbott <>,,
Subject: Re: [PATCH v6] kernel.h: Retain constant expression output for

* Kees Cook <> wrote:

> In the effort to remove all VLAs from the kernel[1], it is desirable to
> build with -Wvla. However, this warning is overly pessimistic, in that
> it is only happy with stack array sizes that are declared as constant
> expressions, and not constant values. One case of this is the evaluation
> of the max() macro which, due to its construction, ends up converting
> constant expression arguments into a constant value result.
> All attempts to rewrite this macro with __builtin_constant_p() failed with
> older compilers (e.g. gcc 4.4)[2]. However, Martin Uecker constructed[3] a
> mind-shattering solution that works everywhere. Cthulhu fhtagn!
> This patch updates the min()/max() macros to evaluate to a constant
> expression when called on constant expression arguments. This removes
> several false-positive stack VLA warnings from an x86 allmodconfig
> build when -Wvla is added:


Acked-by: Ingo Molnar <>

How many warnings are left in an allmodconfig build?



Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.