Using compiler plugins

Lubos Lunak l.lunak at suse.cz
Fri Aug 3 09:36:04 PDT 2012


On Friday 03 of August 2012, Caolán McNamara wrote:
> On Fri, 2012-08-03 at 15:05 +0200, Lubos Lunak wrote:
> > - Find out what we can actually use it for. Some EasyHacks are a good
> > start, but the list might get quite long.
>
> I'd be interested to know it'd be possible, in theory anyway, to detect
> e.g. pointless OUString instances where only its ctor and dtor are
> called and nothing else ?

 You mean things like this?

void foo()
{
OUString a;
}

 Yes, even in practice, see attachment.

 But I think this one is generic enough that it should be actually preferably 
done upstream. There are already GCC/Clang attributes pure and const for 
marking functions, so there could be a similar attribute to mark ctors/dtors 
of classes where the ctor/dtor themselves do not have any side-effects (for a 
suitable definition of side-effect).

-- 
 Lubos Lunak
 l.lunak at suse.cz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loplugin.tar.gz
Type: application/x-tgz
Size: 6958 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120803/ef219b98/attachment.bin>


More information about the LibreOffice mailing list