From: Stefan Tauner <stefan.tauner@gmx.at>
To: newlib@sourceware.org
Subject: Re: [EXTERNAL]: Re: Why int32_t is long int on 32 Bit Intel?
Date: Sat, 29 Jul 2023 15:19:58 +0200 [thread overview]
Message-ID: <1Mq2nA-1q4Riv0aPK-00n9QW@mail.gmx.net> (raw)
In-Reply-To: <CADqjcyh-15rCzHYcpj91Yb_o84v=ySLKeLscRSZpqTdma7Hb_g@mail.gmail.com>
On Sat, 29 Jul 2023 08:47:22 -0400
Trampas Stern <trampas@gmail.com> wrote:
> Most code and libraries, like FAT libraries, all assume a char is 8bit.
Well, it's mandated by POSIX to be 8 bits and in general a quite
reasonable assumption (if targeting POSIX systems) but not necessarily
true elsewhere... and if you depend on the signedness of char you are
doing it wrong too. If you want 8 unsigned bits you should use uint8_t
instead of char. In that regard it's quite similar to the int
"problem". In either case there is a proper solution in C that is
working on all conforming systems.
> right shift sign extended.
Right shifts of negative integers is UB in C (and not necessarily
sign-extended) if that's what you mean. We are also quite off-topic
already IMHO...
--
Kind regards/Mit freundlichen Grüßen, Stefan Tauner
next prev parent reply other threads:[~2023-07-29 13:20 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 11:55 panda.trooper
2023-07-27 23:13 ` Brian Inglis
2023-07-28 8:06 ` panda.trooper
2023-07-28 13:23 ` Anders Montonen
2023-07-28 14:15 ` Joel Sherrill
2023-07-28 15:49 ` [EXTERNAL]: " Mike Burgess
2023-07-28 16:11 ` Stefan Tauner
2023-07-28 16:26 ` Mike Burgess
2023-07-28 17:06 ` Richard Damon
2023-07-28 18:05 ` Grant Edwards
2023-07-28 18:27 ` panda.trooper
2023-07-28 20:23 ` Jon Beniston
2023-07-28 21:42 ` panda.trooper
2023-07-28 21:53 ` Jon Beniston
2023-07-29 12:47 ` Trampas Stern
2023-07-29 13:19 ` Stefan Tauner [this message]
2023-07-29 21:21 ` Grant Edwards
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=1Mq2nA-1q4Riv0aPK-00n9QW@mail.gmx.net \
--to=stefan.tauner@gmx.at \
--cc=newlib@sourceware.org \
/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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).