From owner-freebsd-ports@FreeBSD.ORG Tue Aug 30 19:42:10 2005 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 20A9916A429 for ; Tue, 30 Aug 2005 19:42:10 +0000 (GMT) (envelope-from maverick31337@vfemail.net) Received: from ybbsmtp28.mail.tnz.yahoo.co.jp (ybbsmtp28.mail.tnz.yahoo.co.jp [203.216.229.8]) by mx1.FreeBSD.org (Postfix) with SMTP id CF38143D46 for ; Tue, 30 Aug 2005 19:42:08 +0000 (GMT) (envelope-from maverick31337@vfemail.net) Received: from unknown (HELO ?192.168.0.1?) (badtrans666@219.197.212.140 with plain) by ybbsmtp28.mail.tnz.yahoo.co.jp with SMTP; 30 Aug 2005 19:42:06 -0000 X-Apparently-From: Message-ID: <4314B68E.5070502@vfemail.net> Date: Wed, 31 Aug 2005 04:42:06 +0900 From: "Tetsuji \"Maverick\" Rai" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a1) Gecko/20050828 SeaMonkey/1.1a MIME-Version: 1.0 To: freebsd-ports@freebsd.org X-Enigmail-Version: 0.92.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: ICC ports has a trouble with ANSI string class which g++ doesn't have (FreeBSD5.4 ICC8.1.032) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2005 19:42:10 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I minimized this problem to a small test case. Compile this simple program and compile and run, you'll find the problem as follows: testcase code. - ----t1.cpp------ #include #include #include // convert every character to lower case void downcase_string(std::string& w) { std::transform(w.begin(), w.end(), w.begin(), (int(*)(int))tolower); } int main(int argc, char** argv){ if(argc != 2){ fprintf(stderr, "Usage: %s \n", argv[0]); exit(1); } std::string fn = argv[1]; downcase_string(fn); std::cout << fn << std::endl; return 0; } - ---------------- If it's compiled with g++ it succeeds as follows: - --------- freebsd54:~/tmp% g++ -o t1-gcc t1.cpp freebsd54:~/tmp% ./t1-gcc aAAAa aaaaa freebsd54:~/tmp% - ---------- However if it's compiled with icpc, it fails and dumps core: - ---------- freebsd54:~/tmp% icpc -o t1-icc t1.cpp freebsd54:~/tmp% ./t1-icc aAAAa terminate called after throwing an instance of 'std::length_error' what(): basic_string::_S_create zsh: abort (core dumped) ./t1-icc aAAAa - ----------- what's the problem and how can I fix it? TIA - -- Tetsuji 'Maverick' Rai PGP Key fingerprint = 2021 6BF9 CEA3 73DE FF17 B326 F4DA F04E F784 3B85 gpg fingerprint Aviation Jokes: http://www.geocities.com/tetsuji_rai/ Profile http://maverick.ns1.name/ http://maverick.IsASecret.com/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFDFLaO9NrwTveEO4URAslpAKCF1ka8BlDKbMePvdl/4rQRBomccQCdEx2d iYAGpB/2ENK+yI6fiJRz0kA= =DS2b -----END PGP SIGNATURE-----