[net.lang.c] strcture comparisons, NULL, extern, and typedef

mp@whuxle.UUCP (Mark Plotnick) (04/07/84)

Some comments on recent events.

Re structure comparison:
A reference to the C Class system is "Adding Classes to the C Language:
An Exercise in Language Evolution" by Bjarne Stroustrup, in Software -
Practice and Experience, Feb. 1983.  The system allows you to define abstract
datatypes along with functions to manipulate
those datatypes.  The functions include overloaded binary operators,
such as =, ==, and <.  The functions can be implemented in-line if you wish.
I hear that it is available to the outside world, or at least to
Universities.

Re NULL and pointers of different widths:
Out of curiosity, does anyone know of any C compilers that do indeed
implement pointers that are different physical widths?
Some people mentioned the Prime and the PDP-10, but no specifics.
The 2 PDP-10 C compilers I've seen both align everything on word
boundaries (yes, a 10-element array of characters takes 10 words).
A pointer is always an 18-bit value, right-justified in a 36-bit word.

Re extern:
Apparently "int foo();" and "extern int foo();" are equivalent, but try
this on your pcc:
	typedef int func();
	func alpha;
You get "compiler error: compiler takes size of function".  Oh well.
	extern func alpha;
seems to work OK.

	Mark