summaryrefslogtreecommitdiffstats
path: root/qa/coccinelle/uint.cocci
diff options
context:
space:
mode:
Diffstat (limited to 'qa/coccinelle/uint.cocci')
-rw-r--r--qa/coccinelle/uint.cocci13
1 files changed, 13 insertions, 0 deletions
diff --git a/qa/coccinelle/uint.cocci b/qa/coccinelle/uint.cocci
new file mode 100644
index 0000000..d7e6af7
--- /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)