lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <76573179-1e38-4620-bf59-6801341802b5@wanadoo.fr>
Date: Sun, 28 Jul 2024 19:51:42 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: David Laight <David.Laight@...LAB.COM>,
 "'linux-kernel@...r.kernel.org'" <linux-kernel@...r.kernel.org>
Cc: 'Linus Torvalds' <torvalds@...uxfoundation.org>,
 'Jens Axboe' <axboe@...nel.dk>,
 "'Matthew Wilcox (Oracle)'" <willy@...radead.org>,
 'Christoph Hellwig' <hch@...radead.org>,
 'Andrew Morton' <akpm@...ux-foundation.org>,
 'Andy Shevchenko' <andriy.shevchenko@...ux.intel.com>,
 'Dan Carpenter' <dan.carpenter@...aro.org>, 'Arnd Bergmann'
 <arnd@...nel.org>, "'Jason@...c4.com'" <Jason@...c4.com>,
 "'pedro.falcato@...il.com'" <pedro.falcato@...il.com>,
 'Mateusz Guzik' <mjguzik@...il.com>,
 "'linux-mm@...ck.org'" <linux-mm@...ck.org>,
 'Lorenzo Stoakes' <lorenzo.stoakes@...cle.com>
Subject: Re: [PATCH v2 2/8] minmax: Use _Static_assert() instead of
 static_assert()

Le 28/07/2024 à 16:18, David Laight a écrit :
> The static_assert() wrapper provides the text of the expression as the
> error message, this isn't needed here as an explicit message is provided.
> If there is an error (quite likely for min/max) the wrapper also adds
> two more lines of error output that just make it harder to read.
> 
> Since it gives no benefit and actually makes things worse directly
> using _Static_assert() is much better.
> 
> Signed-off-by: David Laight <david.laight@...lab.com>
> ---
> v2:
> - No change.
> 
>   include/linux/minmax.h | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/include/linux/minmax.h b/include/linux/minmax.h
> index cea63a8ac80f..ab64b2e73ae5 100644
> --- a/include/linux/minmax.h
> +++ b/include/linux/minmax.h
> @@ -48,7 +48,7 @@
>   #define __cmp_once(op, x, y, unique_x, unique_y) ({	\
>   	typeof(x) unique_x = (x);			\
>   	typeof(y) unique_y = (y);			\
> -	static_assert(__types_ok(x, y),			\
> +	_Static_assert(__types_ok(x, y),			\

Nitpick, should there be a v3: a tab can be removed to keep things aligned.

>   		#op "(" #x ", " #y ") signedness error, fix types or consider u" #op "() before " #op "_t()"); \
>   	__cmp(op, unique_x, unique_y); })

CJ

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ