C
Chad
In the following code, there is a something like func( z, z++, z++ )
[cdalten@localhost oakland]$ more luc.c
#include <stdio.h>
int func( int a, int b, int c )
{
printf( "a is %d and b is %d and c is %d\n", a, b, c );
return(c);
}
int main( void )
{
int z = 9;
func( z, z++, z++ );
return 0;
}
[cdalten@localhost oakland]$ gcc -Wall luc.c -o luc
luc.c: In function ‘main’:
luc.c:12: warning: operation on ‘z’ may be undefined
luc.c:12: warning: operation on ‘z’ may be undefined
[cdalten@localhost oakland]$ ./luc
a is 11 and b is 10 and c is 9
[cdalten@localhost oakland]$
Is func( z, z++, z++) a constraint violation?
Chad
[cdalten@localhost oakland]$ more luc.c
#include <stdio.h>
int func( int a, int b, int c )
{
printf( "a is %d and b is %d and c is %d\n", a, b, c );
return(c);
}
int main( void )
{
int z = 9;
func( z, z++, z++ );
return 0;
}
[cdalten@localhost oakland]$ gcc -Wall luc.c -o luc
luc.c: In function ‘main’:
luc.c:12: warning: operation on ‘z’ may be undefined
luc.c:12: warning: operation on ‘z’ may be undefined
[cdalten@localhost oakland]$ ./luc
a is 11 and b is 10 and c is 9
[cdalten@localhost oakland]$
Is func( z, z++, z++) a constraint violation?
Chad