lkml.org 
[lkml]   [2017]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] zsmalloc: use U suffix for negative literals being shifted
On Sat, Dec 23, 2017 at 09:33:40PM -0500, Nick Desaulniers wrote:
> Fixes warnings about shifting unsigned literals being undefined
> behavior.

Do you mean signed literals?

> */
> - link->next = -1 << OBJ_TAG_BITS;
> + link->next = -1U << OBJ_TAG_BITS;
> }

I don't understand what -1U means. Seems like a contradiction in terms,
a negative unsigned number. Is this supposed to be ~0U?

\
 
 \ /
  Last update: 2017-12-24 04:26    [W:0.110 / U:4.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site