Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 04 Feb 2023 08:08:36 +0100
From: "alice" <alice@...ya.dev>
To: <musl@...ts.openwall.com>
Cc: "Peter Collingbourne" <pcc@...gle.com>
Subject: Re: [PATCH] arm: Use __WCHAR_TYPE__ for wchar_t if defined

On Sat Feb 4, 2023 at 7:30 AM CET, Peter Collingbourne wrote:
> When building with -fshort-wchar the definition of wchar_t is
> incorrect. Get the correct definition from the compiler if available.
>
> This is useful when reusing the freestanding parts of musl on a
> bare-metal target that uses -fshort-wchar.

somebody talked about this in 2015, see
https://www.openwall.com/lists/musl/2015/02/18/2
for the previous discussion.

i understand in this case it's proposed a little different-
"reusing freestanding parts" as opposed to building a whole libc.so, but in
that case you could most likely patch this in when reusing it standalone only?

it doesn't seem a good idea for it to be there, in general.

> ---
>  arch/arm/bits/alltypes.h.in | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/bits/alltypes.h.in b/arch/arm/bits/alltypes.h.in
> index d62bd7bd..9596466b 100644
> --- a/arch/arm/bits/alltypes.h.in
> +++ b/arch/arm/bits/alltypes.h.in
> @@ -12,8 +12,12 @@
>  #define __LONG_MAX 0x7fffffffL
>  
>  #ifndef __cplusplus
> +#ifdef __WCHAR_TYPE__
> +TYPEDEF __WCHAR_TYPE__ wchar_t;
> +#else
>  TYPEDEF unsigned wchar_t;
>  #endif
> +#endif
>  
>  TYPEDEF float float_t;
>  TYPEDEF double double_t;
> -- 
> 2.39.1.519.gcb327c4b5f-goog

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.