[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

Re: Places where ARM C++ isn't upwards compatable from ANSI

>From vlad!mark Thu Jul 26 01:00:27 1990

				Struct Tags

	p26: Probably the most significant non-upwards compatability between
	ANSI C and ARM C++ is not having a separate name space for tags.  In
	particular, the following is legal ANSI C, but was not legal ARM C++:

		struct stat {...};

		extern struct stat stat(int, struct stat *);

	Unfortunately, the non-upwards compatablity here apparently proved too
	painful, so they've adopted a wierd and hard to understand scoping
	convention (described on p26-27 and p166-167) which preserves the new
	single name space, but lets more old C programs work (such as the
	above).  It's still not upwards compatable from ANSI C, it just
	happens to work for more old programs.

	I think we should pretend that the new scoping hack doesn't exist.  I
	find it quite hard to think about.  I also have no idea how one would
	parse the language as defined: The lexer must distinguish between a
	type identifier & a non-type identifier (which it would otherwise be
	able to do via a feedback channel from the parser).

	This is not an issue in our own C++ code, but is an issue for our
	parser based tools (e.g. formic).  Formic currently ignores the new
	scoping hack (as I advocated).  Rating: 3

I'm afraid that this hack will probably enable all the manufacturers of headerfiles,
particurlarly of window systems, to leave things as they were rather than cleaning up
the namespaces.  We will have to deal with that.  Probably we will have to hack the offending
*.h files for cfront2,0 before we get an ARM compliant C++ so it may not really matter much.