[Mesa-dev] [PATCH] util/u_atomic: use STATIC_ASSERT() when selecting the appropriate function

Matt Turner mattst88 at gmail.com
Wed May 13 09:43:17 PDT 2015


On Wed, May 13, 2015 at 10:37 AM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> As we evaluate sizeof() at compile time, having the run-time assert()
> does not provide any benefits. Move to the compile-time version
> STATIC_ASSERT() which will kindly prompt us when this go wrong.
>
> Cc: Matt Turner <mattst88 at gmail.com>
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> ---

Oh, good idea. Presumably you confirmed that the STATIC_ASSERT
triggers at compile-time when you pass an unsupported type to the
macro? If so,

Reviewed-by: Matt Turner <mattst88 at gmail.com>


More information about the mesa-dev mailing list