[comp.lang.c++] aliasing in inline function calls

akwright@water.UUCP (Andrew K. Wright) (12/06/86)

There appears to have been no attempt to detect aliasing among arguments
to inline functions in C++.  The following trivial program generates
different results if the inline keyword is inserted where shown.
Is this a known problem?  Or worse yet, is this they way it is *supposed*
to work?
----------------------------
#include <stdio.h>
int x;

	/* inline */ int
f( int q, int *r ) {

	return x = ++(*r) && q;
}

main() {
	int a = 0;
	int *b = &a;

	printf( "%d\n", f( a, b ) );
}

bs@alice.UUCP (12/08/86)

Inline functions have the same semantics as non-inline functions.
Any example to the contrary is a bug.