Subject: toolchain/14896: new toolchain: include/g++/iostdio.h and lib/libstdc++ are not in sync
To: None <>
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
>Originator:     Robert Elz
>Release:        NetBSD-current 20011126
	Prince of Songkla University
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

	<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)

	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)


		#include <iostdio.h>

		char line[100];

			sprintf(line, "%d", 1);

	put it in, and g++


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


	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.