ifaddr.cocci 674 B

123456789101112131415161718192021222324252627282930313233343536
  1. /// the address of a variable or field is non-zero is likely always to bo
  2. /// non-zero
  3. ///
  4. // Confidence: High
  5. // Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2.
  6. // Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2.
  7. // URL: http://coccinelle.lip6.fr/
  8. // Comments:
  9. // Options: --no-includes --include-headers
  10. virtual org
  11. virtual report
  12. virtual context
  13. @r@
  14. expression x;
  15. statement S1,S2;
  16. position p;
  17. @@
  18. *if@p (&x)
  19. S1 else S2
  20. @script:python depends on org@
  21. p << r.p;
  22. @@
  23. cocci.print_main("test of a variable/field address",p)
  24. @script:python depends on report@
  25. p << r.p;
  26. @@
  27. msg = "ERROR: test of a variable/field address"
  28. coccilib.report.print_report(p[0],msg)