From stdcxx-dev-return-2743-apmail-incubator-stdcxx-dev-archive=incubator.apache.org@incubator.apache.org Tue Mar 06 15:35:50 2007 Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 70854 invoked from network); 6 Mar 2007 15:35:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Mar 2007 15:35:49 -0000 Received: (qmail 49547 invoked by uid 500); 6 Mar 2007 15:35:58 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 49532 invoked by uid 500); 6 Mar 2007 15:35:58 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 49521 invoked by uid 99); 6 Mar 2007 15:35:58 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Mar 2007 07:35:58 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [208.30.140.160] (HELO moroha.quovadx.com) (208.30.140.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Mar 2007 07:35:47 -0800 Received: from qxvcexch01.ad.quovadx.com ([192.168.170.59]) by moroha.quovadx.com (8.13.6/8.13.6) with ESMTP id l26FZPr0005040 for ; Tue, 6 Mar 2007 15:35:25 GMT X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: ifstream Behaves Strangely when using Static Linking Date: Tue, 6 Mar 2007 08:35:26 -0700 Message-ID: In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: ifstream Behaves Strangely when using Static Linking Thread-Index: AcdgBBbgcJy1I1WWRXyjxkt2PVpYPwAAMLwg References: From: "Patrick Happel" To: X-Virus-Checked: Checked by ClamAV on apache.org Sorry, first time using this list. Here's the text of the .cpp file, and the input file: Newtester.cpp: #include #include #include =20 #include int main() { std::ifstream fMap("./newmap",std::ios::in); if (!fMap) { std::cerr << "cannot open bubble map" << std::endl; return false; } std::string str1, str2, str3; while (fMap.peek() !=3D EOF) { fMap >> str1 >> str2 >> str3; std::cerr << "first column value is: " << str1 << std::endl; } return 0; } Newmap: taco burrito quesedilla foo bar boofar old now new one two three -----Original Message----- From: Patrick Happel [mailto:phappel@quovadx.com]=20 Sent: Tuesday, March 06, 2007 8:28 AM To: stdcxx-dev@incubator.apache.org Subject: ifstream Behaves Strangely when using Static Linking A customer I'm supporting has run into an issue with ifstream when linking an application statically on AIX. I've attached a test case that reads tokens in from a file three at a time, and prints them out. When compiled with dynamic linking, the application behaves as expected, but when compiled with static linking, the entire file is put into one string, without breaking on whitespace. I'm using a 12s build type for this, so I'm not sure why there should be a problem with using static linking. The customer is specifying the linking via the '-bstatic' flag. I'm not entirely sure if this option is supported by the Standard Library. I noted in the documentation for Visual Age that the Native Standard Library is always compiled with dynamic linking. I'm not sure of the reasons for this, but figured I should point it out. I tested this on AIX 5L v5.3, using XLC 7.0 64-bit, with patches up to 8/31/2005 applied. The Standard Library being used is version 4.1.4. I've attached the test file, and included included the output I get below. Any input would be appreciated. =20 Thanks, -Patrick Happel =20 Rogue Wave Software, A QUOVADX(tm) division Technical Support Phone: 303-545-3227 -- 1-800-404-4767 E-mail: support@roguewave.com Web: http://www.roguewave.com/support [phappel@gemini filetest]$ xlCcore_r -q64 -I/package/1/compilers/5.2.0/va70_20050831/root/usr/vacpp/include -I. -O -D_REENTRANT -qsuppress=3D1500-029 -qnotempinc -c newtester.cpp -o newtester.o [phappel@gemini filetest]$ xlCcore_r -q64 -O -D_REENTRANT -Wl,-bh:5 -qnotempinc -o newtester newtester.o -lC =20 [phappel@gemini filetest]$ ./newtester first column value is: taco first column value is: foo first column value is: old first column value is: one first column value is: one [phappel@gemini filetest]$ xlCcore_r -q64 -O -D_REENTRANT -Wl,-bh:5 -qnotempinc -o newtester newtester.o -bstatic -lC -bdynamic [phappel@gemini filetest]$ ./newtester first column value is: taco first column value is: foo first column value is: old first column value is: one first column value is: one [phappel@gemini filetest]$ cp newtester.cpp ~/temp/newtester2.cpp [phappel@gemini filetest]$ xlCcore_r -q64 -D_RWCONFIG=3D12s10g -I./../Ed9_12s10g/include -I./../Ed9_12s10g/include/ansi -I./../Ed9_12s10g/ -I. -O -D_REENTRANT -qsuppress=3D1500-029 -qnotempinc -c newtester.cpp -o newtester.o [phappel@gemini filetest]$ xlCcore_r -q64 -O -D_REENTRANT -Wl,-bh:5 -qnotempinc -D_RWCONFIG=3D12s10g -o newtester newtester.o -L./../Ed9_12s10g/lib -lstd12s10g [phappel@gemini filetest]$ ./newtester first column value is: taco first column value is: foo first column value is: old first column value is: one first column value is: one [phappel@gemini filetest]$ xlCcore_r -q64 -O -D_REENTRANT -Wl,-bh:5 -qnotempinc -D_RWCONFIG=3D12s10g -o newtester newtester.o -bstatic -L./../Ed9_12s10g/lib -lstd12s10g -bdynamic [phappel@gemini filetest]$ ./newtester first column value is: taco burrito quesedilla foo bar boofar old now new one two three [phappel@gemini filetest]$=20 =20