fix_non_ANSI_function_declarations.cocci 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // StarPU --- Runtime system for heterogeneous multicore architectures.
  2. //
  3. // Copyright (C) 2012 inria
  4. //
  5. // StarPU is free software; you can redistribute it and/or modify
  6. // it under the terms of the GNU Lesser General Public License as published by
  7. // the Free Software Foundation; either version 2.1 of the License, or (at
  8. // your option) any later version.
  9. //
  10. // StarPU is distributed in the hope that it will be useful, but
  11. // WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. //
  14. // See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. virtual context
  16. virtual org
  17. virtual patch
  18. virtual report
  19. @r@
  20. identifier f;
  21. position p;
  22. @@
  23. f@p()
  24. {
  25. ...
  26. }
  27. @depends on r && context@
  28. identifier r.f;
  29. position r.p;
  30. @@
  31. * f@p()
  32. {
  33. ...
  34. }
  35. @script:python depends on r && org@
  36. f << r.f;
  37. p << r.p;
  38. @@
  39. coccilib.org.print_todo(p[0], "Fix non-ANSI function declaration of function %s." % f)
  40. @depends on r && patch@
  41. identifier r.f;
  42. position r.p;
  43. @@
  44. -f@p()
  45. +f(void)
  46. {
  47. ...
  48. }
  49. @script:python depends on r && report@
  50. f << r.f;
  51. p << r.p;
  52. @@
  53. coccilib.report.print_report(p[0], "Non-ANSI function declaration of function %s." % f)