lkml.org 
[lkml]   [2019]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 05/10] efi/libstub: distinguish between native/mixed not 32/64 bit
On Sat, Dec 14, 2019 at 09:30:08PM +0000, Ard Biesheuvel wrote:
> On Sat, 14 Dec 2019 at 22:17, Arvind Sankar <nivedita@alum.mit.edu> wrote:
> >
> > Maybe just do
> > if (sizeof(at) < sizeof(__ret))
> > __ret = (__typeof__(__ret))(uintptr_t)at;
> > else
> > __ret = (__typeof__(__ret))at;
> > That should cover most of the cases.
>
> But the compiler will still be unhappy about the else clause if __ret
> is a pointer type, since we'll be casting an u32 to a pointer,

Ugh, yeah it complains even though it can tell at compile time that that
branch isn't taken.

\
 
 \ /
  Last update: 2019-12-14 23:14    [W:0.041 / U:2.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site