mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-30 08:00:51 +00:00
33a3f92503
The means that the actual call expression is not in the statement lint of the enclosing block expression, but just its result, whether the call is void or not. This actually simplifies several things, but most importantly will make Ruamoko calls easier to implement. The test is because I had some trouble with double-calls, and is how I found the return-postop issue :P
28 lines
400 B
R
28 lines
400 B
R
#include "test-harness.h"
|
|
|
|
int counter;
|
|
|
|
int
|
|
function (void)
|
|
{
|
|
return ++counter;
|
|
}
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
int ret = 0;
|
|
counter = 0;
|
|
//function ();
|
|
//if (counter != 1) {
|
|
//printf ("discarded return not called only once\n");
|
|
// ret = 1;
|
|
//}
|
|
counter = 0;
|
|
printf ("function: %d\n", function ());
|
|
if (counter != 1) {
|
|
//printf ("used return not called only once\n");
|
|
ret = 1;
|
|
}
|
|
return ret;
|
|
}
|