[Bug libstdc++/11584] ios::iword() fails to zero-initialize storage on failure
bkoz at redhat dot com
gcc-bugzilla@gcc.gnu.org
Mon Jan 26 20:36:00 GMT 2004
------- Additional Comments From bkoz at redhat dot com 2004-01-26 20:36 -------
Subject: Re: ios::iword() fails to zero-initialize
storage on failure
>The only thing I really see wrong with the patch is that it zeros both
>the iword and pword failure storage, rather than the one being
>accessed. I'm going to post a modified patch as soon as I update the
>test case.
Ok.
>BTW, it doesn't seem to me to be a requirement that test case in this
>bug produce 0. The standard says that a failure to allocate space
>should return 0 storage, but it doesn't say how that space has to be
>allocated. Our implementation has a small amount of preallocated
>space, so accessing slot 1 doesn't fail. The problem that was raised
>is still generally valid, though.
Right. The issue, I think, is that the standard is under-specified.
What we should do, in the meantime, is try to come up with sensible
behavior. We have some test cases in this PR already, but what we should
do is document the new, "sensible" libstdc++ behavior in test cases.
Then, perhaps Martin could tell us if the sensible libstdc++ behavior,
as defined in these test cases, is sensible to him, as another library
vendor.
Once we have behavior that RW and libstdc++ agree is sensible, one of us
should submit a defect report.
-benjamin
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11584
More information about the Gcc-bugs
mailing list