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)