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

Nad Ka french.cryptonad at gmail.com
Sat Sep 5 14:29:33 CEST 2026


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gmp-c23-knr-lshift-com-ab4a7408e2ce-upstream-submission.tar.gz
Type: application/octet-stream
Size: 45691 bytes
Desc: not available
URL: <https://gmplib.org/list-archives/gmp-bugs/attachments/20260905/b061670a/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gmp-c23-knr-lshift-com-ab4a7408e2ce-upstream-submission.tar.gz.sha256
Type: application/octet-stream
Size: 176 bytes
Desc: not available
URL: <https://gmplib.org/list-archives/gmp-bugs/attachments/20260905/b061670a/attachment-0003.obj>


More information about the gmp-bugs mailing list