[comp.bugs.4bsd] ar

sam@think.UUCP (03/27/87)

Index:	bin/ld.c 4.3BSD

Description:
	The command
		ar r archive file_with_name_longer_than_14_characters
	will silently fail to replace that file in archive if it is
	already present there.

	This bug is present in Mt. Xinu 4.3BSD and in Ultrix X2.0, but
	it is NOT present in Sun 3.2.

Repeat-By:
	Here is a script of a demonstration of the problem.  ranlib
	isn't used in this example purposely, because ranlib has
	nothing to do with the problem.

	% cat > Makefile
	a.out: t.o l.a
		$(CC) t.o l.a

	l.a: longnameindeed.o
		ar r l.a longnameindeed.o
	% cat > t.c
	main(){ f(); }
	% cat > longnameindeed.c
	f(){ printf("OLD\n"); }
	% make
	cc  -c longnameindeed.c
	ar r l.a longnameindeed.o
	ar: filename longnameindeed.o truncated to longnameindeed.
	ar: creating l.a
	cc  -c t.c
	cc t.o l.a
	ld:l.a: warning: archive has no table of contents; add one using ranlib(1)
	% a.out
	OLD
	% cat > longnameindeed.c
	f(){ printf( "NEW\n" ); }
	% make
	cc  -c longnameindeed.c
	ar r l.a longnameindeed.o
	ar: filename longnameindeed.o truncated to longnameindeed.
	cc t.o l.a
	ld:l.a: warning: archive has no table of contents; add one using ranlib(1)
	% a.out		# should say NEW, but says OLD
	OLD
	% cc t.o longnameindeed.o
	% a.out
	NEW
	% 

---
Sam Kendall			sam@Think.COM
Thinking Machines Corp.		{seismo,ihnp4}!think!sam