From 70bd93621397cdad1b1f08855a9f93fa28f8e766 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Thu, 12 Jun 2025 15:19:39 -0400 Subject: [PATCH] Ignore sparse error about stat.h on el8. On el8, sparse is at 0.6.4 in epel-release, but it fails with: ``` [SP src/util.c] src/util.c: note: in included file (through /usr/include/sys/stat.h): /usr/include/bits/statx.h:30:6: error: not a function /usr/include/bits/statx.h:30:6: error: bad constant expression type ``` This is due to us needing O_DIRECT from , so we set _GNU_SOURCE before including it, but this causes (through _USE_GNU in sys/stat.h) statx.h to be included, and that has __has_include, and sparse is too dumb to understand it. Just shut it up. Signed-off-by: Auke Kok --- utils/sparse.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/sparse.sh b/utils/sparse.sh index 0b93324f..adef573b 100755 --- a/utils/sparse.sh +++ b/utils/sparse.sh @@ -22,6 +22,11 @@ RE="$RE|warning: memset with byte count of 4194304" # some sparse versions don't know about some builtins RE="$RE|error: undefined identifier '__builtin_fpclassify'" +# on el8, sparse can't handle __has_include for some reason when _GNU_SOURCE +# is defined, and we need that for O_DIRECT. +RE="$RE|note: in included file .through /usr/include/sys/stat.h.:" +RE="$RE|/usr/include/bits/statx.h:30:6: error: " + # # don't filter out 'too many errors' here, it can signify that # sparse doesn't understand something and is throwing a *ton*