mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-19 02:28:27 -05:00
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.
19 lines
145 B
Text
19 lines
145 B
Text
@ rule1 @
|
|
identifier f1;
|
|
@@
|
|
|
|
void f1(...)
|
|
{
|
|
...
|
|
}
|
|
|
|
@ rule2 @
|
|
identifier rule1.f1;
|
|
identifier f2;
|
|
@@
|
|
|
|
void f2(...) {
|
|
...
|
|
* return(f1(...));
|
|
...
|
|
}
|