From: David CARLIER Date: Mon, 7 Feb 2022 00:35:28 +0000 (+0000) Subject: Fix FreeBSD 14 build (#975) X-Git-Tag: SQUID_5_4_1~2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=cf08b9f9bdf6755c33ea1fd72efba11d27058b9f;p=thirdparty%2Fsquid.git Fix FreeBSD 14 build (#975) FreeBSD 14 defines 3-parameter CPU_AND() macro as a `do {} while` loop. Our (void) in front of that loop creates a syntax error. CpuAffinitySet.cc:41:16: error: expected expression (void) CPU_AND(&cpuSet, &cpuSet, &theOrigCpuSet); That (void) was added in commit 7ec6d51 to "remove GNU-specific syntax", but we cannot tell what specific problem that 10-year old change solved. Known 3-parameter CPU_AND(3) documentation says the call returns void. --- diff --git a/src/CpuAffinitySet.cc b/src/CpuAffinitySet.cc index 96f9faf37f..2d74d012b8 100644 --- a/src/CpuAffinitySet.cc +++ b/src/CpuAffinitySet.cc @@ -38,7 +38,7 @@ CpuAffinitySet::apply() } else { cpu_set_t cpuSet; memcpy(&cpuSet, &theCpuSet, sizeof(cpuSet)); - (void) CPU_AND(&cpuSet, &cpuSet, &theOrigCpuSet); + CPU_AND(&cpuSet, &cpuSet, &theOrigCpuSet); if (CPU_COUNT(&cpuSet) <= 0) { debugs(54, DBG_IMPORTANT, "ERROR: invalid CPU affinity for process " "PID " << getpid() << ", may be caused by an invalid core in "