"Sertonix" writes: > 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? The prototype uses restrict for both pointers which is how you tell the C compiler that two objects will not overlap. But maybe it is better to be friendly to those new to see and state it explicitly? Alex will know better than I. Collin