Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!seismo!brl-adm!brl-smoke!gwyn
From: gwyn@brl-smoke.ARPA (Doug Gwyn )
Newsgroups: comp.lang.c
Subject: Re: Reserved words in C
Message-ID: <5485@brl-smoke.ARPA>
Date: Tue, 6-Jan-87 11:34:01 EST
Article-I.D.: brl-smok.5485
Posted: Tue Jan  6 11:34:01 1987
Date-Received: Wed, 7-Jan-87 23:02:33 EST
References: <1524@hoptoad.uucp> <1016@zeus.UUCP> <5476@brl-smoke.ARPA> <1199@ucbcad.berkeley.edu>
Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) )
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 28

In article <1199@ucbcad.berkeley.edu> faustus@ucbcad.berkeley.edu (Wayne A. Christopher) writes:
>If a standard library has a function called 'read' in it, I don't see how
>this could alter the *behavior of the program* ...

/*	Demonstrate problem with extensions in the C library	*/

#include 

extern int	read();

int
main()	{
	int	c = read();

	(void) printf( "Got: 0%o\n", c );
	return 0;
	}

/*	The following might be in a separate file, so that
	external linkage will be forced to occur as expected	*/
int
read()	{
	return getchar();
	}

On a system (such as UNIX) where getchar() is implemented via an
eventual call to a function named read() in the C library, this
program will go bonkers, even though it is strictly conforming.