On 2023-03-26 21:17, Martin D Kealey wrote:
While C has never guaranteed that pointers all have the same size &
alignment, POSIX does provide this guarantee, although indirectly (it has
to be true for dlsym() to work, for example).
My commit message was a bit misleading, as the problem is not limited to
platforms where pointers can differ in size or representation. The
problem can also occur on platforms where calling conventions differ
depending on type even if the two types have the same representation,
and this can (and has) occurred on platforms with linear address spaces.
The patch fixes an actual (albeit unlikely) bug on GNU/Linux x86-64, due
to a variant of that sort of thing.
I'm all for tidying up the code so that it can compile
cleanly and run reliably.
Yes, it's a win overall.
The patch is not enough to make Bash entirely C23-safe, alas; more work
needs to be done in this area. Unfortunately it's a bit of a pain due to
the K&R cruft still present (which can fight with C23).