Obscure C code (was Re: Excessive optimization)
cclist at sydex.com
Thu Dec 2 22:15:26 CST 2010
On 2 Dec 2010 at 19:30, Brent Hilpert wrote:
> Those annoying semi-colons. (Plus I hope you had "true" defined
There are lots of those...
/* program illustrating use of pointers */
int a, b, c;
a = 10;
b = 2;
p = &b; /* p points to b */
c = a/*p; /* divide 10/2 */
; /* null statements are legal in C */
printf( "%d divided by %d is %d\n", a, b, c);
Compile and run:
D:\tmp>cl /AS x.c
Microsoft (R) C/C++ Optimizing Compiler Version 8.00c
Copyright (c) Microsoft Corp 1984-1993. All rights reserved.
Microsoft (R) Segmented Executable Linker Version 5.60.339 Dec 5
Copyright (C) Microsoft Corp 1984-1993. All rights reserved.
Object Modules [.obj]: x.obj
Run File [x.exe]: "x.exe" /noi
List File [nul.map]: NUL
Definitions File [nul.def]: ;
10 divided by 2 is 10
Digraphs are nasty.
More information about the cctalk