From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11662 invoked by alias); 1 Jul 2005 09:12:21 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 11642 invoked by uid 48); 1 Jul 2005 09:12:18 -0000 Date: Fri, 01 Jul 2005 09:12:00 -0000 Message-ID: <20050701091218.11641.qmail@sourceware.org> From: "chris at bubblescope dot net" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050701030031.22265.kpbhat@sta.samsung.com> References: <20050701030031.22265.kpbhat@sta.samsung.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug libstdc++/22265] Non -native type entry is getting added to an STL Map incorrectly X-Bugzilla-Reason: CC X-SW-Source: 2005-07/txt/msg00033.txt.bz2 List-Id: ------- Additional Comments From chris at bubblescope dot net 2005-07-01 09:12 ------- on 4.0.0, ppc-darwin I don't see this problem. On x86-cygwin 3.4.4 I do, but I don't think it has anything to do with map, or net, or anything. Consider the following program below. It prints: bat:bat on x86-cygwin 3.4.4 and bat:zat on ppc-darwin current CVS inet_ntoa returns a char* to a fixed internal buffer which contains the decoded net string. You are calling this function twice in one statement, and if you print the pointers you are returned you'll find (or at least I find, and I can't see how it could be otherwise) that these pointers are identical. Now another question, which I'm not 100% certain at the moment and am happy to have input on, is what about output this program should give, or if it is undefined. #include char foo[10]="cat"; char* writestring() { foo[0]='b'; return foo; } char* write2() { foo[0]='z'; return foo; } int main(void) { std::cout << writestring() << ":" << write2() << std::endl; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22265