From: "Sertonix" <sertonix@posteo.net>
To: "Alejandro Colomar" <alx@kernel.org>
Cc: <linux-man@vger.kernel.org>
Subject: swab.3: mention UB when from and to overlap
Date: Sat, 11 Oct 2025 22:18:05 +0000 [thread overview]
Message-ID: <DDFUAR7OXZ38.3SGS6R89CDDMD@posteo.net> (raw)
The current swab.3 page doesn't seem to mention anything about what
happens when from and to overlap. In POSIX any overlap is UB.
glibc handles cases when from == to but it will choke when for example
from == to+1. I am uncertain if from == to is meant to be a feature.
If it is, would it be possible to mention that overlap is only safe when
from == to and it's glibc (not eg. musl)? If it's not intended would it
be possible to include the same information as in POSIX?
next reply other threads:[~2025-10-11 22:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-11 22:18 Sertonix [this message]
2025-10-11 22:40 ` swab.3: mention UB when from and to overlap Collin Funk
2025-10-12 0:02 ` Alejandro Colomar
2025-10-12 10:42 ` Sertonix
2025-10-12 11:04 ` Alejandro Colomar
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=DDFUAR7OXZ38.3SGS6R89CDDMD@posteo.net \
--to=sertonix@posteo.net \
--cc=alx@kernel.org \
--cc=linux-man@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.