Subject: toolchain/14896: new toolchain: include/g++/iostdio.h and lib/libstdc++ are not in sync
To: None <gnats-bugs@gnats.netbsd.org>
From: None <kre@munnari.OZ.AU>
List: netbsd-bugs
Date: 12/10/2001 18:00:16
>Number:         14896
>Category:       toolchain
>Synopsis:       include/g++/iostdio.h and lib/libstdc++ are not in sync
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 10 07:37:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Robert Elz
>Release:        NetBSD-current 20011126
>Organization:
	Prince of Songkla University
>Environment:
System: NetBSD fuchsia 1.5Y NetBSD 1.5Y (FUCHSIA) #2: Mon Nov 26 13:41:27 ICT 2001 kre@fuchsia:/usr/obj/sys/FUCHSIA i386
Architecture: i386
Machine: i386


>Description:
	<include/g++/iostdio.h> redefines sprintf as IO_sprintf
	and vsprintf as IO_vsprintf

	lib/libstdc++ has neither IO_sprintf nor IO_vsprintf

	With gcc 2.95.3 that is.

	(With the old toolchain, egcs-XXX, libstdc++ has those two functions)

>How-To-Repeat:
	By inspection ...

	cd /usr/include/g++
	grep sprint iostdio.h
			Note the output
	cd /usr/include
	nm libstdc++.a | grep sprint
			Note the lack of output
			(aside from an unsatisfied instance of sprintf
			which is irrelevant)

	Alternatively

		#include <iostdio.h>

		char line[100];

		main()
		{
			sprintf(line, "%d", 1);
			exit(0);
		}

	put it in junk.cc, and g++ junk.cc

	Observe...

	/var/tmp/cc1LeG5Y.o: In function `main':
	/var/tmp/cc1LeG5Y.o(.text+0x16): undefined reference to `_IO_sprintf'

>Fix:

	Either remove the #defines of the two sprintf functions from 
	iostdio.h or implement the two IO_*sprintf functions ..

	I don't know which one is correct.
>Release-Note:
>Audit-Trail:
>Unformatted: