Ok, you can do it like this:
#include <stdbool.h>
#include <stdio.h>
static int first(int value)
{
static bool first = false;
if (!first)
{
first = true;
return value;
}
return 0;
}
int main(void)
{
const int x = first(1) + first(2);
printf("got %d\n", x);
}
On ideone.com I received 1.
Note that this does not prove anything, since there is no specific behavior. Draft C99 states (in 6.5 terms, paragraph 3):
. 72) , ( - (), &&, ||, ?: ), , , .