// filename:c2011-6-8-6-4-ex.c // original examples and/or notes: // (c) ISO/IEC JTC1 SC22 WG14 N1570, April 12, 2011 // C2011 6.8.6.4 The return statement // 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 // Example struct s { double i; } f(void); union { struct { int f1; struct s f2; } u1; struct { struct s f3; int f4; } u2; } g; struct s f(void) { return g.u1.f2; } /* ... */ int main(void) { g.u2.f3 = f(); return printf("6.8.6.4 The return statement %f \n",g.u2.f3.i); } // output may be // 6.8.6.4 The return statement 0.000000