Qualified Names mean you don't break the C Library

mark at elsie.UUCP mark at elsie.UUCP
Thu Jul 26 07:30:40 AEST 1984


<>
One way to avoid collision between your own subroutine names and those that
may be used by the C libraries is to declare all routines that are used only
in a single source file to be static. Thus if I want to write my own malloc,
I write:
	static malloc(size)
	unsigned	size;
	{
	...
	}
This will (should) not interfere with any malloc's used by the library. Of
course if I want to this malloc from other files of a multi-file source, I
can't use static so I'd better change the name.

-- 
Mark J. Miller
NIH/NCI/DCE/LEC
UUCP:	decvax!harpo!seismo!umcp-cs!elsie!mark
Phone:	(301) 496-5688



More information about the Comp.unix mailing list