[BUG/PATCH] C23: old-style lshift_com definitions in configure probes

Marc Glisse marc.glisse at inria.fr
Sun Sep 6 19:20:22 CEST 2026


Thanks, done. I was tempted to just remove this 20+ year old test for a 
long dead compiler, maybe next time...

On Sat, 5 Sep 2026, Nad Ka wrote:

> Hello,
>
> I found a C23 compatibility issue in the current GMP development tip.
>
> Upstream revision:
> ab4a7408e2ce
>
> acinclude.m4 contains two mpn_lshift_com configure probes whose
> lshift_com functions use old-style K&R definitions.
>
> On AArch64 with Clang in GNU23 mode, the unpatched configure run fails
> when these probes are compiled.
>
> Reproducer configuration:
>
>  ABI=64
>  CC=clang
>  CXX=clang++
>  CFLAGS="-O2 -std=gnu23"
>  --enable-cxx --disable-static --enable-shared
>
> The proposed patch changes only acinclude.m4 and converts the two
> lshift_com definitions to modern prototypes.
>
> Validation against the same upstream revision:
>
>  GCC GNU23 configure/build/make check: PASS
>  Clang GNU23 configure/build/make check: PASS
>  true test failures: 0
>
> The failing unpatched config.log is attached together with the patch,
> reproducer and environment information.
>
> Public evidence:
>
> Finding:
> https://github.com/frenchcryptonad-max/linux-arm64-build-findings/commit/60de53223aab7cbdc34208ce7c5484a1903cc268
>
> Validated fix:
> https://github.com/frenchcryptonad-max/linux-arm64-build-findings/commit/e4dbdd2f5b203f77e2bcac62130af4b41d8bd98a
>
> Regards,
> FrenchCryptoNad
>

-- 
Marc Glisse


More information about the gmp-bugs mailing list