You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Martin Sebor <se...@roguewave.com> on 2007/03/12 17:33:51 UTC

[Fwd: Re: svn commit: r511019 - in /incubator/stdcxx/trunk/tests: include/23.list.h src/23.containers.cpp]

Farid, please make sure to correct the static inline issue
in this patch before we forget.

Thanks
Martin

-------- Original Message --------
Subject: Re: svn commit: r511019 - in /incubator/stdcxx/trunk/tests: 
include/23.list.h src/23.containers.cpp
Date: Tue, 06 Mar 2007 19:24:16 -0700
From: Martin Sebor <se...@roguewave.com>
Organization: Rogue Wave Software
To: stdcxx-dev@incubator.apache.org
References: <20...@eris.apache.org>

faridz@apache.org wrote:
> Author: faridz
> Date: Fri Feb 23 09:04:11 2007
> New Revision: 511019
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=511019
> Log:
> 2007-02-23 Farid Zaripov <fa...@kyiv.vdiweb.com>
> 
> 	ChangeLog:
> 	* 23.list.h: New file with definitions of helpers used in
> 	clause 23.list tests.
> 	* 23.containers.cpp: #included 23.list.h; removed definition
> 	of the temporary struct ListIds; _rw_list_sigcat filled by code.
> 
> Added:
>     incubator/stdcxx/trunk/tests/include/23.list.h   (with props)
> Modified:
>     incubator/stdcxx/trunk/tests/src/23.containers.cpp
> 
> Added: incubator/stdcxx/trunk/tests/include/23.list.h
> URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/include/23.list.h?view=auto&rev=511019
> ==============================================================================
> --- incubator/stdcxx/trunk/tests/include/23.list.h (added)
> +++ incubator/stdcxx/trunk/tests/include/23.list.h Fri Feb 23 09:04:11 2007
> @@ -0,0 +1,285 @@
[...]
> +template <class InputIter1, class InputIter2>
> +static inline bool
    ^^^^^^

I suspect the static linkage is going to cause the same problem
as in 23.limits.traps. We're already getting warnings from Sun
C++:

CC -c -D_RWSTD_USE_CONFIG -I$(TOPDIR)/include -I$(BUILDDIR)/include
-I$(TOPDIR)/../rwtest -I$(TOPDIR)/tests/include  -library=%none -O
-xarch=v9 +w   $(TOPDIR)/tests/src/23.containers.cpp
"$(TOPDIR)/tests/include/23.list.h", line 228: Warning (Anachronism):
"static" is not allowed and is being ignored.

[...]
> +template <class List>
> +struct ListState
> +{
> +    typedef typename List::const_iterator  ListCIter;
> +    typedef typename List::const_pointer   ListCPtr;
> +
> +    _RWSTD_SIZE_T size_;
> +    ListCIter*    iters_;
> +    ListCPtr*     ptrs_;
> +
> +    ListState (List const & lst) : size_ (lst.size ()), iters_ (0), ptrs_ (0)
> +    {

The formatting convention is not to drop the curly brace in
definitions of member functions in the body of the "parent"
class.

> +        iters_ = new ListCIter [size_];
> +        ptrs_  = new ListCPtr  [size_];
> +
> +        _RWSTD_SIZE_T index = 0;
> +        for (ListCIter it = lst.begin (), end = lst.end ();
> +            it != end; ++it, ++index) {
> +
> +            iters_ [index] = it;
> +            ptrs_  [index] = &*it;
> +        }
> +    }
> +
> +    ~ListState ()
> +    {

Same here.

> +        delete [] iters_;
> +        delete [] ptrs_;
> +    }
> +
> +    // invokes rw_assert() to verify that two states are the same
> +    void assert_equal (const ListState& state, int line,
> +                       int case_line, const char* when) const
> +    {

And here.

> +        const int equal =    size_ == state.size_

It probably doesn't matter (I don't think any compiler issues
a warning) but I suppose the type of the constant should be int.

Martin



Re: [Fwd: Re: svn commit: r511019 - in /incubator/stdcxx/trunk/tests: include/23.list.h src/23.containers.cpp]

Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [mailto:sebor@roguewave.com] 
>> Sent: Monday, March 12, 2007 6:34 PM
>> To: stdcxx-dev@incubator.apache.org
>> Subject: [Fwd: Re: svn commit: r511019 - in 
>> /incubator/stdcxx/trunk/tests: include/23.list.h 
>> src/23.containers.cpp]
>>
>> Farid, please make sure to correct the static inline issue in 
>> this patch before we forget.
> 
>   Done:  http://svn.apache.org/viewvc?view=rev&rev=517283
> 
>>> +        const int equal =    size_ == state.size_
>> It probably doesn't matter (I don't think any compiler issues 
>> a warning) but I suppose the type of the constant should be int.
> 
>   Do you mean that here should be bool instead of int, right?

Yes, that's what I meant. Like I said, I'm not sure there's
a compiler that complains about bool to int conversions (MSVC
complains about going in the other direction which is annoying
as heck but I don't think it complains about this -- yet). The
main issue in this patch was the static inline since that as
we know causes real problems.

Martin


RE: [Fwd: Re: svn commit: r511019 - in /incubator/stdcxx/trunk/tests: include/23.list.h src/23.containers.cpp]

Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Monday, March 12, 2007 6:34 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: [Fwd: Re: svn commit: r511019 - in 
> /incubator/stdcxx/trunk/tests: include/23.list.h 
> src/23.containers.cpp]
> 
> Farid, please make sure to correct the static inline issue in 
> this patch before we forget.

  Done:  http://svn.apache.org/viewvc?view=rev&rev=517283

> > +        const int equal =    size_ == state.size_
> 
> It probably doesn't matter (I don't think any compiler issues 
> a warning) but I suppose the type of the constant should be int.

  Do you mean that here should be bool instead of int, right?

Farid.