This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -Wcast-qual broken(?) for libstdc++


----- Original Message -----
From: "Gerald Pfeifer" <pfeifer@dbai.tuwien.ac.at>
To: "Benjamin Kosnik" <bkoz@redhat.com>
Cc: "Gawain Bolton" <gp.bolton@computer.org>; <libstdc++@gcc.gnu.org>
Sent: Monday, July 14, 2003 5:48 PM
Subject: Re: -Wcast-qual broken(?) for libstdc++


> On Fri, 11 Jul 2003, Benjamin Kosnik wrote:
> > I've made libstdc++/11504 which will track this.
>
> Thanks!
>
> Do you think we could add -Wcast-qual as a default flag to the libstdc++
> testsuite?  I cannot see any downside (apart from the extremely unlikely
> case that GCC contains a bug that only triggers when -Wcast-qual is not
> specified).
>
> In the meantime, and assuming Gawain will work on fixing the remaining
> issues, how about the small patch I proposed at
>
>   http://gcc.gnu.org/ml/libstdc++/2003-07/msg00177.html
>
> which at least fixes one of the issues and will, in some form, be needed
> also for a complete fix.  (Patch included also below.)

Hi Gerald,

I agree that the function you are adding in your patch will be required.
However, I think you will find that your patch will cause problems in other
functions due to const poisoning.  This is the reason I will need time to
solve the casting and const issues cleanly.  Currently I'm on vacation and
unable to do this.

Cheers,


Gawain

>
> Gerald
>
>
> 2003-07-10  Gerald Pfeifer  <pfeifer@dbai.tuwien.ac.at>
>
> * include/bits/stl_tree.h (_Rb_tree): Add non-const version of
> _M_end().
>
> Index: include/bits/stl_tree.h
> ===================================================================
> RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/stl_tree.h,v
> retrieving revision 1.26
> diff -u -3 -p -r1.26 stl_tree.h
> --- include/bits/stl_tree.h 9 Jul 2003 20:58:32 -0000 1.26
> +++ include/bits/stl_tree.h 10 Jul 2003 11:45:37 -0000
> @@ -378,6 +378,9 @@ namespace std
>
>        _Link_type
>        _M_end() const { return (_Link_type) &this->_M_header; }
> +
> +      _Link_type
> +      _M_end() { return (_Link_type) &this->_M_header; }
>
>        static _Link_type&
>        _S_left(_Link_type __x) { return (_Link_type&)(__x->_M_left); }
>
>



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]