On 12/09/2025 18:48, Collin Funk wrote:
Hi Pádraig,
Ah, I should have known that we needed this in Gnulib for crc32. Thanks
for working on it.
I'll give a more through review later, but one thing that that popped
out to me during an initial skim:
+ if (0);
+# if defined __x86_64__
+ else if (STREQ (feature, "avx")) hwcap = "-AVX";
+ else if (STREQ (feature, "avx2")) hwcap = "-AVX2";
+ else if (STREQ (feature, "avx512bw")) hwcap = "-AVX512BW";
+ else if (STREQ (feature, "avx512f")) hwcap = "-AVX512F";
+ else if (STREQ (feature, "pclmul")) hwcap = "-PCLMULQDQ";
+ else if (STREQ (feature, "vpclmulqdq")) hwcap = "-VPCLMULQDQ";
+# elif defined __aarch64__
+ else if (STREQ (feature, "pmull")) hwcap "-PMULL";
+# endif
+
+ return hwcap;
+}
I like the attempt to minimize lines of code, but I recall clang warning
about this by default:
$ cat main.c
int
main (void)
{
if (0);
return 0;
}
$ clang main.c
main.c:5:9: warning: if statement has empty body [-Wempty-body]
5 | if (0);
| ^
main.c:5:9: note: put the semicolon on a separate line to silence this
warning
1 warning generated.
$ clang -v 2>&1 | head -n 1
clang version 20.1.8 (Fedora 20.1.8-4.fc42)
Also, lib/cpu-supports.c needs a copyright header.
Fixed up both locally.
Note clang build proceeded without warning,
but I think that's because explicit warnings aren't enabled with clang
(I don't normally build with clang so haven't looked at that).
cheers,
Padraig