// c2011-6-5-16-1-ex.c
// original examples and/or notes
// (c) ISO/IEC JTC1 SC22 WG14 N1570, April 12, 2011
// C2011 6.5.16.1 Simple assignment
// compile and output mechanism
// (c) Ogawa Kiyoshi, kaizen@gifu-u.ac.jp, December.xx, 2013
// compile errors and/or wornings
// (c) Apple LLVM version 4.2 (clang-425.0.27) (based on LLVM 3.2svn)
// Target: x86_64-apple-darwin11.4.2 //Thread model: posix
// (c) LLVM 2003-2009 University of Illinois at Urbana-Champaign.
#include <stdio.h>
// Example 1
int f(void);

int f(void){
char c;
/* ... */
return (int)c; }

int main(void)
{
char c;
if ((c = f()) == -1) printf("c=%d",c);
/* ... */
// Example 2	
int i;
long l;
l = (c = i);
printf("%d %d %ld ", c,i,l);
// Example 3
const char **cpp;
char *p;
const char cc = 'A';
cpp = &p; // constraint violation
*cpp = &cc; // valid
*p = 0; // valid
	return printf("6.5.16.1 Simple assignment %d %d %d",(int)cpp,(int)p,cc);
}
//c2011-6-5-16-ex.c:35:5: warning: assigning to 'const char **' from 'char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types]
//cpp = &p; // constraint violation
//    ^ ~~
//1 warning generated.
//output may be
//-1 32767 -1 6.5.16.1 Simple assignment 1689193064 1689193063 65