Does ANSI insist this is legal?

Ronald Guilmette rfg at paris.ics.uci.edu
Wed Feb 28 19:09:52 AEST 1990


Must a strictly conforming ANSI C implementation be able to generate an
executable program from the following?


	int main ();

	short s = (short) &main;
	char c = (char) &main;

	int main () { return 0; }

The above code makes SystemV assemblers croak and it makes BSD linkers croak.


// Ron Guilmette (rfg at ics.uci.edu)
// C++ Entomologist
// Motto:  If it sticks, force it.  If it breaks, it needed replacing anyway.



More information about the Comp.std.c mailing list