[Assorted-commits] SF.net SVN: assorted: [654] sandbox/trunk/src/c
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-04-06 02:25:58
|
Revision: 654 http://assorted.svn.sourceforge.net/assorted/?rev=654&view=rev Author: yangzhang Date: 2008-04-05 19:25:54 -0700 (Sat, 05 Apr 2008) Log Message: ----------- added literals tests Added Paths: ----------- sandbox/trunk/src/c/literals.c sandbox/trunk/src/cc/literals.cc Added: sandbox/trunk/src/c/literals.c =================================================================== --- sandbox/trunk/src/c/literals.c (rev 0) +++ sandbox/trunk/src/c/literals.c 2008-04-06 02:25:54 UTC (rev 654) @@ -0,0 +1,12 @@ +// Integer literals test. + +#include <stdio.h> + +int +main() +{ + // This works fine (gets -10). + long long x = 0xFFFFFFFFFFFFFFF6; + printf("%lld\n", x); + return 0; +} Added: sandbox/trunk/src/cc/literals.cc =================================================================== --- sandbox/trunk/src/cc/literals.cc (rev 0) +++ sandbox/trunk/src/cc/literals.cc 2008-04-06 02:25:54 UTC (rev 654) @@ -0,0 +1,15 @@ +// Integer literals test. Same as ../c/literals.c. A post claimed that this +// wouldn't work in C++: +// +// http://bytes.com/forum/thread137121.html + +#include <stdio.h> + +int +main() +{ + // This also works fine (gets -10). + long long x = 0xFFFFFFFFFFFFFFF6; + printf("%lld\n", x); + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |