mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "alice" <alice@ayaya.dev>
To: <musl@lists.openwall.com>
Cc: "Peter Collingbourne" <pcc@google.com>
Subject: Re: [musl] [PATCH] arm: Use __WCHAR_TYPE__ for wchar_t if defined
Date: Sat, 04 Feb 2023 08:08:36 +0100	[thread overview]
Message-ID: <CQ9L8J42M5SC.2KNL0F70AM877@sumire> (raw)
In-Reply-To: <20230204063021.2681891-1-pcc@google.com>

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


  reply	other threads:[~2023-02-04  7:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-04  6:30 Peter Collingbourne
2023-02-04  7:08 ` alice [this message]
2023-02-05 20:00   ` Markus Wichmann
2023-02-05 23:49     ` Rich Felker
2023-02-07  1:15       ` Peter Collingbourne
2023-02-07 14:59         ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CQ9L8J42M5SC.2KNL0F70AM877@sumire \
    --to=alice@ayaya.dev \
    --cc=musl@lists.openwall.com \
    --cc=pcc@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).