fix_non_ANSI_function_declarations.cocci 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2012-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), 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. */
  16. virtual context
  17. virtual org
  18. virtual patch
  19. virtual report
  20. @r@
  21. identifier f;
  22. position p;
  23. @@
  24. f@p()
  25. {
  26. ...
  27. }
  28. @depends on r && context@
  29. identifier r.f;
  30. position r.p;
  31. @@
  32. * f@p()
  33. {
  34. ...
  35. }
  36. @script:python depends on r && org@
  37. f << r.f;
  38. p << r.p;
  39. @@
  40. coccilib.org.print_todo(p[0], "Fix non-ANSI function declaration of function %s." % f)
  41. @depends on r && patch@
  42. identifier r.f;
  43. position r.p;
  44. @@
  45. -f@p()
  46. +f(void)
  47. {
  48. ...
  49. }
  50. @script:python depends on r && report@
  51. f << r.f;
  52. p << r.p;
  53. @@
  54. coccilib.report.print_report(p[0], "Non-ANSI function declaration of function %s." % f)