From: Amos Jeffries Date: Mon, 9 Jun 2025 04:49:04 +0000 (+0000) Subject: CI: Fix gperf 3.2 output filter (#2081) X-Git-Tag: SQUID_7_0_2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d324cee1d30b4e7940705471c7ac24068c2a7226;p=thirdparty%2Fsquid.git CI: Fix gperf 3.2 output filter (#2081) gperf 3.2 now provides properly compiler and C++ version scoped fallthrough attributes. Our filter to convert the gperf 3.1 and older output for C++17 attribute requirements is now broken and produces compiler errors due to listing '[[fallback]];' on two consecutive lines. --- diff --git a/scripts/source-maintenance.sh b/scripts/source-maintenance.sh index e2cca2e164..ea2d890f56 100755 --- a/scripts/source-maintenance.sh +++ b/scripts/source-maintenance.sh @@ -662,8 +662,15 @@ generateRawGperfFile () echo "/* $GeneratedByMe */" echo - (cd `dirname $gperfFile` && gperf -m 100000 `basename $gperfFile`) | \ - sed 's@/[*]FALLTHROUGH[*]/@[[fallthrough]];@g' + if test `gperf --version | head -1 | cut -d ' ' -f 3 | cut -d. -f '-2' | sed -e 's/\.//'` -lt 32 ; then + # We configure C++ compilers to complain about missing '[[fallthrough]]' attribute + # where old gperf versions use a '/*FALLTHROUGH*/' code comment. + (cd `dirname $gperfFile` && gperf -m 100000 `basename $gperfFile`) | \ + sed -e 's@/[*]FALLTHROUGH[*]/@[[fallthrough]];@g' + else + # gperf 3.2+ provide fallthrough attributes + (cd `dirname $gperfFile` && gperf -m 100000 `basename $gperfFile`) + fi } generateGperfFile ()