Am 29.09.2010 um 14:24 schrieb Abdelrazak Younes: > On 09/28/2010 03:16 PM, Stephan Witt wrote: >> Am 27.09.2010 um 13:54 schrieb Pavel Sanda: >> >> >>> Stephan Witt wrote: >>> >>>> But seriously: there is already one fragile separator implementation! >>>> >>> yes and we already have one crashing bug just in the return d->text_[pos] >>> == ' '; >>> point (6453) ;) >>> >> I had a look and now I'm asking myself: >> is it a good idea to check the pos value here? >> >> Normally I'd do that. But I know some people have the opinion: >> "I'd like to crash the program if the function is called with invalid >> arguments." >> >> But then an ASSERT should be added. >> > > No, the debug version of the STL already has boundary checking. We cannot and > will not assert everywhere the [] operator is used.
I see. And what's the policy regarding the release version? There is no runtime check then?! But undefined behavior... I understand that the possible consequences in this special case are not that terrible. But in general? >> Anyway, we should do something with the FIXME. >> An implementation of isSeparator has to try harder, IMHO. >> > > I agree (obviously as I wrote the FIXME :-)) I investigated a little bit, it's mostly used by RTL/Bidi code... I guess I'll leave it untouched. :( Stephan PS. Thanks for answering my other question. The decision there was to move the checker forward explicitly after adding a misspelled word to personal dictionary. Then - in case of failing to add the word - the speller does not gets stuck at least.
