Re: [PATCH] Fix strict aliasing violations in a few string functions

Bruno Haible via Gnulib discussion list <[email protected]> Sun, 26 Jul 2026 14:37:36 +0200
Newsgroups gmane.comp.lib.gnulib.bugs
Message-ID <6957858.31r3eYUQgx@cagnes>
Lasse Collin wrote:
> In theory it can matter with LTO. Before LTO, translation unit
> boundaries made this kind of tricks safe in practice. I don't know if
> these specific cases can cause issues with LTO in the real world. I
> just thought these were straightforward to fix (for compilers that
> support the may_alias attribute), and I didn't see any downsides in the
> fix.

I don't see any downsides either. But I wanted to understand the problem
and its scope.

Let's hear Paul's opinion.

Bruno