diff --git a/lib/isc/histo.c b/lib/isc/histo.c index fa4ca5b06d..7aac5c36ca 100644 --- a/lib/isc/histo.c +++ b/lib/isc/histo.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include diff --git a/lib/isc/include/isc/types.h b/lib/isc/include/isc/types.h index 2c4a73be01..8a74a161aa 100644 --- a/lib/isc/include/isc/types.h +++ b/lib/isc/include/isc/types.h @@ -13,6 +13,7 @@ #pragma once +#include #include /*! \file isc/types.h @@ -20,7 +21,6 @@ * OS-specific types, from the OS-specific include directories. */ #include -#include #include #include #include diff --git a/util/checklibs.sh b/util/checklibs.sh index fdb9bee494..e0f8c79d64 100755 --- a/util/checklibs.sh +++ b/util/checklibs.sh @@ -42,4 +42,26 @@ list=$(git grep -l uintptr_t lib bin \ echo "$list" } +# +# Check for the direct usage of stdatomic.h +# +list=$(git grep -l stdatomic.h lib bin ':(exclude)lib/isc/include/isc/atomic\.h' \ + | grep -e '\.c$' -e '\.h$') +[ -n "$list" ] && { + status=1 + echo 'Use #include instead of #include :' + echo "$list" +} + +# +# Check for the usage of explicit memory ordering +# +list=$(git grep -l memory_order_.* lib bin ':(exclude)lib/isc/include/isc/atomic\.h' \ + | grep -e '\.c$' -e '\.h$') +[ -n "$list" ] && { + status=1 + echo 'Prefer the helpers in over specifying an explicit memory order:' + echo "$list" +} + exit $status