This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [google gcc-4_7,gcc-4_8,integration] Add bounds checks to vector<bool>
- From: Miles Bader <miles at gnu dot org>
- To: Paul Pluzhnikov <ppluzhnikov at google dot com>
- Cc: Jonathan Wakely <jwakely dot gcc at gmail dot com>, Diego Novillo <dnovillo at google dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 05 Jun 2013 14:28:31 +0900
- Subject: Re: [google gcc-4_7,gcc-4_8,integration] Add bounds checks to vector<bool>
- References: <ye6q7gip66eq dot fsf at elbrus2 dot mtv dot corp dot google dot com> <CALoOobNTTBRvLKLg_arRYbpRTA+oiVo2KyGd+owE6RB=+CFUZA at mail dot gmail dot com> <CAH6eHdQ5BihsSg5NuEMS8rZgk3Nu-0uF+ALTV1-rCy9s0uS_1g at mail dot gmail dot com> <CALoOobNH5wXnWXRechGDeUvFxE3E=3Ow1Hdm2V+h8STN3nmAuw at mail dot gmail dot com>
Paul Pluzhnikov <ppluzhnikov@google.com> writes:
> Keying off NDEBUG rather than __OPTIMIZE__ seems like a more
> consistent approach -- if you want assert()s, then you probably also
> want these checks.
That's a bad idea. NDEBUG ("Be really slow unless the user has
positively defined this macro, whose use is rare enough that many
people will not even be aware of it") should be used less, not more.
The __OPTIMIZE__ is far superior, because it happens automatically
when the user specifies any optimization option.
-miles
--
Guilt, n. The condition of one who is known to have committed an indiscretion,
as distinguished from the state of him who has covered his tracks.