lkml.org 
[lkml]   [2018]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 12/12] efi: make const array 'apple' static

* Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:

> > Also, would it make sense to rename it to something more descriptive like
> > "apple_unicode_str[]" or so?
> >
> > Plus an unicode string literal initializer would be pretty descriptive as well,
> > instead of the weird looking character array, i.e. something like:
> >
> > static efi_char16_t const apple_unicode_str[] = u"Apple";
> >
> > ... or so?
> >
>
> is u"xxx" the same as L"xxx"?

So "L" literals map to wchar_t, which wide character type is implementation
specific IIRC, could be 16-bit or 32-bit wide.

u"" literals OTOH are specified by the C11 spec to be char16_t, i.e. 16-bit wide
characters - which I assume is the EFI type as well?

> In any case, this is for historical reasons: at some point (and I
> don't remember the exact details) we had a conflict at link time with
> objects using 4 byte wchar_t, so we started using this notation to be
> independent of the size of wchar_t. That issue no longer exists so we
> should be able to get rid of this.

Yes, my guess is that those problems were due to L"xyz" mapping to wchar_t and
having a different type in the kernel build and the host build side - but u"xyz"
should solve that.

Thanks,

Ingo

\
 
 \ /
  Last update: 2018-03-09 09:05    [W:0.076 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site