[20.05,15/15] devtools: check use of compiler attributes

Message ID 20200210162032.1177478-16-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series clean-up use of __attribute__ |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot success Travis build: passed
ci/Intel-compilation success Compilation OK

Commit Message

Thomas Monjalon Feb. 10, 2020, 4:20 p.m. UTC
  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 <thomas@monjalon.net>
---
 devtools/checkpatches.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Patch

diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index b16bace927..bbde89bc99 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -61,6 +61,14 @@  check_forbidden_additions() { # <patch>
 		-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' \