From 2d20636989c8935efa36bf03cb18645c2460d7b5 Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Mon, 10 Feb 2020 17:00:32 +0100 Subject: [PATCH] devtools: check use of compiler attributes The keyword __attribute__ will emit a warning, because it is preferred to use or define a common __rte macro. The centralized macros may help to control or workaround some compilers. Signed-off-by: Thomas Monjalon --- devtools/checkpatches.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index 1794468376..c30ce64cc1 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -61,6 +61,14 @@ check_forbidden_additions() { # -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ "$1" || res=1 + # refrain from using compiler attribute without defining a common macro + awk -v FOLDERS="lib drivers app examples" \ + -v EXPRESSIONS="__attribute__" \ + -v RET_ON_FAIL=1 \ + -v MESSAGE='Using compiler attribute directly' \ + -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ + "$1" || res=1 + # svg figures must be included with wildcard extension # because of png conversion for pdf docs awk -v FOLDERS='doc' \ -- 2.20.1