Addin exceptions in SvStream

Michael Meeks michael.meeks at suse.com
Thu Dec 13 03:45:29 PST 2012


Hi Marc,

On Thu, 2012-12-13 at 06:10 -0500, Marc-André Laverdière wrote:
> That's the problem... what we don't know can be hurting us big time.
> And since the tests are not very thorough, I can't have a good
> confidence that things are not broken.

	Of course.

> So, either we finish this patch and hope people will pick up those
> cases along the way - a risky proposal but it has the advantage of
> immunizing pretty much every filter for 'cheap'.

	and/or breaking it ? :-)

> Otherwise, I suggest that we go for a SvStream wrapper that throws
> exceptions - no changes to SvStream. It can be used wherever wanted,
> so that's a lot of engineering effort to bolt that in place - but less
> work than just putting stream->good() checks everywhere.

	AFAICS throwing an exception without going through and auditing each
call-site will create even more pathalogical problems than just
returning 0 - people who were careless (like they are) and routinely
read over the end of some stream and then later checked will now throw
an exception and fail to read the whole document - right ? :-)

	Personally, I don't see a clean solution beyond reading each of the
call sites to those operators. If we want to take the risk of busting
things - personally I'd prefer zeroing the data: it has a much lower
risk/down-side as far as I can see. Then again - the ideal is clearly to
do the work of code cleanup & audit - that's fairly mindless busy-work
that just needs to be done carefully.

	ATB,

		Michael.

-- 
michael.meeks at suse.com  <><, Pseudo Engineer, itinerant idiot



More information about the LibreOffice mailing list