12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- virtual patch
- virtual context
- virtual org
- virtual report
- @i@
- @@
- #include <linux/kernel.h>
- @depends on i&&context@
- type T;
- T[] E;
- @@
- (
- * (sizeof(E)/sizeof(*E))
- |
- * (sizeof(E)/sizeof(E[...]))
- |
- * (sizeof(E)/sizeof(T))
- )
- @depends on i&&patch@
- type T;
- T[] E;
- @@
- (
- - (sizeof(E)/sizeof(*E))
- + ARRAY_SIZE(E)
- |
- - (sizeof(E)/sizeof(E[...]))
- + ARRAY_SIZE(E)
- |
- - (sizeof(E)/sizeof(T))
- + ARRAY_SIZE(E)
- )
- @r depends on (org || report)@
- type T;
- T[] E;
- position p;
- @@
- (
- (sizeof(E)@p /sizeof(*E))
- |
- (sizeof(E)@p /sizeof(E[...]))
- |
- (sizeof(E)@p /sizeof(T))
- )
- @script:python depends on org@
- p << r.p;
- @@
- coccilib.org.print_todo(p[0], "WARNING should use ARRAY_SIZE")
- @script:python depends on report@
- p << r.p;
- @@
- msg="WARNING: Use ARRAY_SIZE"
- coccilib.report.print_report(p[0], msg)
|