From 5ea58fe3c4e21707edca95a4e373a30284850395 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 14 Jul 2017 21:06:37 +0200 Subject: [PATCH] cocci: add test to check for uint use uint is non-standard and not supported by MinGW. So ban it's use. spatch file by Eric Leblond. --- qa/coccinelle/Makefile.am | 1 + qa/coccinelle/uint.cocci | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 qa/coccinelle/uint.cocci diff --git a/qa/coccinelle/Makefile.am b/qa/coccinelle/Makefile.am index 8ceebe0689..4bc94f9bbb 100644 --- a/qa/coccinelle/Makefile.am +++ b/qa/coccinelle/Makefile.am @@ -7,6 +7,7 @@ EXTRA_DIST= access-pkt-packet.cocci \ size_t.cocci \ struct-flags.cocci \ sz3.cocci \ + uint.cocci \ run_check.sh struct-flags.py if HAVE_COCCINELLE diff --git a/qa/coccinelle/uint.cocci b/qa/coccinelle/uint.cocci new file mode 100644 index 0000000000..2c664288e3 --- /dev/null +++ b/qa/coccinelle/uint.cocci @@ -0,0 +1,13 @@ +@uint@ +uint i; +position p1; +@@ + +i@p1 + +@script:python@ +p1 << uint.p1; +@@ +print "banned type uint used at at %s:%s, please use a explicit length." % (p1[0].file, p1[0].line) +import sys +sys.exit(1)