Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 10248 invoked from network); 15 Mar 2007 21:12:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Mar 2007 21:12:31 -0000 Received: (qmail 67619 invoked by uid 500); 15 Mar 2007 21:12:39 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 67599 invoked by uid 500); 15 Mar 2007 21:12:39 -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 67587 invoked by uid 99); 15 Mar 2007 21:12:39 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2007 14:12:39 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2007 14:12:30 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 00839714085 for ; Thu, 15 Mar 2007 14:12:10 -0700 (PDT) Message-ID: <19674497.1173993129998.JavaMail.jira@brutus> Date: Thu, 15 Mar 2007 14:12:09 -0700 (PDT) From: "Martin Sebor (JIRA)" To: stdcxx-dev@incubator.apache.org Subject: [jira] Closed: (STDCXX-359) [gcc/Mac OS X 10.4.8 Tiger] Can't convert FmtSpec::mod to bool. In-Reply-To: <10180138.1173893289274.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/STDCXX-359?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Sebor closed STDCXX-359. ------------------------------- Resolution: Fixed Assuming the committed patch successfully works around the gcc bug. If not, please reopen. > [gcc/Mac OS X 10.4.8 Tiger] Can't convert FmtSpec::mod to bool. > --------------------------------------------------------------- > > Key: STDCXX-359 > URL: https://issues.apache.org/jira/browse/STDCXX-359 > Project: C++ Standard Library > Issue Type: Bug > Components: Build, Tests > Affects Versions: 4.1.3, 4.1.2 > Environment: Darwin host.local 8.8.1 Darwin Kernel Version 8.8.1: Mon Sep 25 19:42:00 PDT 2006; root:xnu-792.13.8.obj~1/RELEASE_I386 i386 i386 > Reporter: Eric Lemings > Assigned To: Martin Sebor > Fix For: 4.2 > > > The mod data member of the FmtSpec structure is defined in the tests/src/fmt_defs.h header file as shown below. > 65 struct FmtSpec > 66 { > 67 // optional flags > 68 unsigned fl_minus : 1; > ... > 73 > 74 // optional length modifier > 75 enum Modifier { > 76 mod_none = 0, > 77 mod_h, // short modifier > ... > 86 mod_ext_I // extension: int as ios::iostate > 87 }; > 88 > 89 Modifier mod : 5; > (That may be the first time I've ever seen a bitfield defined in terms of an enumeration. But I digress...) This member is checked in the tests/src/printf.cpp source file as shown here and fails to compile on Darwin platforms. > 2885 case 'S': // %{S}, %{lS}, %{#*S} > 2886 if ( spec.mod == spec.mod_l > 2887 || !spec.mod && spec.fl_pound && sizeof (wchar_t) == spec.width) { > 2888 // std::wstring > This should probably be coded as an explicit equality/comparison to the Modifier enumerators. (Also there should probably be parentheses for explicit grouping around the logical OR (||) operands and the logical AND (&&} operands. IIRC, the logical AND operator has precedence over the logical OR operator but I'm not sure.) A patch is shown below. > Index: tests/src/printf.cpp > =================================================================== > --- tests/src/printf.cpp (revision 517771) > +++ tests/src/printf.cpp (working copy) > @@ -2883,8 +2883,8 @@ > break; > > case 'S': // %{S}, %{lS}, %{#*S} > - if ( spec.mod == spec.mod_l > - || !spec.mod && spec.fl_pound && sizeof (wchar_t) == spec.width) { > + if ( spec.mod == spec.mod_l || spec.mod != FmtSpec::mod_none > + && spec.fl_pound && sizeof (wchar_t) == spec.width) { > // std::wstring > spec.param.ptr_ = PARAM (ptr_, pva); > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.