#include <stdio.h>

/* compound-literals.c:20: warning: ISO C90 forbids compound literals
 *         just a warning  ^^^^^^^  and only with -pedantic   */

typedef struct { int a, b; } foo;

void fun1(foo afoo)
{
	printf ("%d, %d\n", afoo.a, afoo.b);
}

void fun2(foo *afoo)
{
	printf ("%d, %d\n", afoo->a, afoo->b);
}

void fun3(int a, int b)
{
	fun1( (foo){3,4});
	fun2(&(foo){3,4});
	fun1( (foo){a,b});
	fun2(&(foo){a,b});
}

int main()
{
	fun3(1, 2);
	return 0;
}

/* Output, just as you would expect:

3, 4
3, 4
1, 2
1, 2

*/

