PR 10975

Jerry Quinn jlquinn@optonline.net
Sat Jan 3 06:06:00 GMT 2004


Nathan Myers writes:
 > On Thu, Jan 01, 2004 at 02:40:36PM -0800, Nathan Myers wrote:
 > > On Thu, Jan 01, 2004 at 02:00:16PM -0500, Jerry Quinn wrote:
 > > > I posted a comment to PR 10975 and think it's invalid, but I'd
 > > > appreciate someone else eyeballing the analysis in case I missed
 > > > something.
 > > > 
 > > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10975
 > > 
 > > I agree that the standard is pretty clear on what is required,
 > > paragraph 11 in particular.  
 > > 
 > > This is pretty clearly a defect in the standard.  
 > 
 > Following up further... There's no requirement for the pointers to be 
 > initialized to 0.  They could just as well all point to ((charT*) this), 
 > for example.  Then, the letter of the standard would be satisfied, and 
 > we could do the right thing immediately, independently of progress on
 > the DR.

Digging in further... the pointers are in fact non-null.  What happens
is that we test for string capacity and return eof because the empty
string has none, rather than allow for the null seek to succeed.

So it seems we could add the special case to permit this function to
return 0 when given a 0 offset.

If people want this, I'll cobble up a patch.

Jerry



More information about the Libstdc++ mailing list