Return-Path: Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: (qmail 9111 invoked from network); 3 Jun 2008 15:39:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Jun 2008 15:39:49 -0000 Received: (qmail 36051 invoked by uid 500); 3 Jun 2008 15:39:46 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 36038 invoked by uid 500); 3 Jun 2008 15:39:46 -0000 Mailing-List: contact dev-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list dev@stdcxx.apache.org Received: (qmail 36019 invoked by uid 99); 3 Jun 2008 15:39:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2008 08:39:46 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.30.140.160] (HELO moroha.roguewave.com) (208.30.140.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2008 15:38:50 +0000 Received: from exchmail01.Blue.Roguewave.Com (exchmail01.blue.roguewave.com [10.22.129.22]) by moroha.roguewave.com (8.13.6/8.13.6) with ESMTP id m53FdBur024137 for ; Tue, 3 Jun 2008 15:39:11 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: [STDCXX-550] Please peer review this change. Date: Tue, 3 Jun 2008 09:39:12 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [STDCXX-550] Please peer review this change. Thread-Index: AcjFCmjHYp6byj0CTJOw7Hhmjx7eHgAhJzdA References: <48445BA9.6030106@roguewave.com> <4844723F.5050004@roguewave.com> <4844850E.7090005@roguewave.com> From: "Eric Lemings" To: X-Virus-Checked: Checked by ClamAV on apache.org =20 > -----Original Message----- > From: Martin Sebor [mailto:msebor@gmail.com] On Behalf Of Martin Sebor > Sent: Monday, June 02, 2008 5:41 PM > To: dev@stdcxx.apache.org > Subject: Re: [STDCXX-550] Please peer review this change. >=20 > Eric Lemings wrote: > > =20 > >=20 > >> -----Original Message----- > >> From: Martin Sebor [mailto:msebor@gmail.com] On Behalf Of=20 > Martin Sebor > >> Sent: Monday, June 02, 2008 4:21 PM > >> To: dev@stdcxx.apache.org > >> Subject: Re: [STDCXX-550] Please peer review this change. > >> > >> Eric Lemings wrote: > >>> =20 > >>> > >>>> -----Original Message----- > >>>> From: Martin Sebor [mailto:sebor@roguewave.com]=20 > >>>> Sent: Monday, June 02, 2008 2:44 PM > >>>> To: dev@stdcxx.apache.org > >>>> Subject: Re: [STDCXX-550] Please peer review this change. > >>>> > >>>> Eric Lemings wrote: > >>>>> =20 > >>>>> Would like to get another set of eyes on this before I submit. > >>>>> > >>>>> $ svn diff include/deque > >>>>> Index: include/deque > >>>>> > >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >>>>> --- include/deque (revision 662487) > >>>>> +++ include/deque (working copy) > >>>>> @@ -749,7 +749,7 @@ > >>>>> void _C_insert (const iterator &__it, > >>>>> _IntType __n, _IntType __x, int) { > >>>>> // see 23.1.1, p9 and DR 438 > >>>>> - _C_insert_n (__it, __n, __x); > >>>>> + _C_insert_n (__it, __n, const_reference (__x)); > >>>> I suspect this is not correct. Suppose the type of __x is > >>>> a 4 byte int and const_reference is an 8 byte long. The cast > >>>> will make _C_insert_n() to read 4 bytes past the end of __x. > >>>> A better fix might be to cast __x to value_type, as long as > >>>> doing so doesn't violate [sequence.reqmts]. > >>> Yep. Good call. Will change to value_type() cast. > >> Do read DR 438 before applying the cast. There are some obscure > >> corner cases here, e.g., IntType being a user-defined "integer- > >> like" type. I don't know if we support this case now, or if we > >> do, if it's being tested, but suffice it to say that there are > >> subtle differences between direct-initialization either via > >> a function-style cast or static_cast, or copy-initialization > >> (passing arguments to functions). > >=20 > > I did read the DR briefly. Perhaps I should add some conditional > > compilation so that __x is converted using value_type() only when > > using Sun C++? That would limit the scope of the change and the > > issue only relates to this compiler anywho. >=20 > I don't think we want to do it differently for different compilers. >=20 > >=20 > > Or should I just skip it entirely and leave the warnings as they > > are? >=20 > That depends on what a small test case looks like. How likely are > users to run into the same warning and what can they do to silence > it? A small test case reproducing the warning should help answer > these questions. I don't think a test case is really needed. Users can easily encounter the warnings anytime they use a deque instantiated with 64-bit integer types as shown by lines 593-601 in file tests/containers/23.deque.modifiers.cpp where the warnings originally appeared. It is just a warning and only for Sun C++ but I see how the explicit conversion could potentially cause problems. Not likely but possible. I'll just put it on hold for now. Brad.