Oh nooo! (gotos)

Roland Schemers schemers at egrunix.UUCP
Fri Sep 8 01:13:09 AEST 1989


I just compiled this, and it works (gcc 1.35.0):

#define begin_loop(name)	for(;;)
#define exit_loop(name)		goto name;
#define end_loop(name)		name:;

main()
{

	begin_loop(test) {
		printf("hello!\n");
		exit_loop(test);
		printf("goodbye!\n");
	} end_loop(test)

}

It only prints "hello!"

-- 
Roland J. Schemers III                  'Real programmers don't write specs.
Systems Programmer                      Users should be grateful for whatever
Oakland University                      they get. They are lucky to get any
schemers at unix.secs.oakland.edu		programs at all.'



More information about the Comp.lang.c mailing list