[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: KDE/kdepimlibs/akonadi/kmime
From:       Allen Winter <winter () kde ! org>
Date:       2008-04-08 13:43:38
Message-ID: 200804080943.39349.winter () kde ! org
[Download RAW message or body]

On Tuesday 08 April 2008 01:56:48 Marc Mutz wrote:
> On Monday April 7 2008 16:52, Allen Winter wrote:
> > --- trunk/KDE/kdepimlibs/akonadi/kmime/messageparts.h #794447:794448
>
> <snip>
>
> > -      static const QLatin1String Envelope;
> > +      static const QLatin1String Envelope( "ENVELOPE" );
>
> This is wrong. Even with string folding optimizing away the multiple copies
> of the string data itself, it will still need to allocate a QLatin1String()
> per translation unit, and run a ctor on it (which is problematic, if that
> ctor comes from another library)...
>
> Sounds like a no-no to me. Make them (non-static) inline functions that
> return the string data:
>   inline QLatin1String envelope() { return QLatin1String("ENVELOPE"); }
>
Yes, we know.
tokoe already discussed this with vkrause and I think they
have a solution in mind.

> Generally speaking: this violates the "do not use static const
> <user-defined type from other lib> in shared objects" rule. How about a
> krazy check for that one? :)

I'll add it to the Krazy to-do list.  Actually may not be that hard to 
implement.



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic