Commit graph

2 commits

Author SHA1 Message Date
Ondřej Surý
60760420aa
Update the semantic patches to use new development ideas
Co-Authored-By: Markus Elfring <Markus.Elfring@web.de>
2025-10-08 17:22:10 +02:00
Ondřej Surý
9dfa33050b Add semantic patch to find void f() { ... return ((void)g())); ... }
When a function returns void, it can be used as an argument to return in
function returning also void, e.g.:

void in(void) {
  return;
}

void out(void) {
  return (in());
}

while this is legal, it should be rewritten as:

void out(void) {
  in();
  return;
}

The semantic patch just find the occurrences, and they need to be fixed
by hand.
2019-12-06 13:42:18 +01:00