Addin exceptions in SvStream

Lubos Lunak l.lunak at suse.cz
Thu Dec 13 05:00:47 PST 2012


On Thursday 13 of December 2012, Michael Meeks wrote:
> 	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.

 I think it shouldn't be that difficult to write a Clang plugin that finds all 
uses of SvStream::operator<</>> , checks whether the variable read to is 
initalized [*] , and possibly it shouldn't be even that big deal to have it 
rewrite them to a series of SvStream::readInt32() etc. calls (i.e. EasyHack 
fdo#56110). I have not written yet any howto on plugins besides the examples 
under compilerplugins/, but if there would be interest, I could do something.

[*] Or, since I assume all those variables have been needlessly initialized 
just in attempt to silence the broken warning with the wretched gcc thing on 
Apple, the check will need to be more complicated and find if the initializer 
is not the default value for the type.

-- 
 Lubos Lunak
 l.lunak at suse.cz


More information about the LibreOffice mailing list