lkml.org 
[lkml]   [2019]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Make is_signed_type() simpler
From
Date
On 29/09/2019 22.06, Alexey Dobriyan wrote:
> * Simply compare -1 with 0,
> * Drop unnecessary parenthesis sets
>
> -#define is_signed_type(type) (((type)(-1)) < (type)1)
> +#define is_signed_type(type) ((type)-1 < 0)

NAK. I wrote it that way to avoid -Wtautological-compare when type is
unsigned.

Rasmus

\
 
 \ /
  Last update: 2019-09-29 22:22    [W:0.047 / U:0.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site