Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On 2012-04-05 14:47, Caolán McNamara wrote:
Cause I worry that someone's going to end up comparing string literals
to each other under some conversion like

-#define FOO rtl::OUString(..."foo"...)
+#define FOO "foo"
-#define BAR rtl::OUString(..."bar"...)
+#define BAR "bar"

if (FOO == BAR)

You could solve that with some tainting.
So you have a boolean flag inside an OUString that says "I was created from a literal". Then you check in the equality operator if the other side also has the flag, and if so, complain loudly.

Obviously this needs to be under some kind of DEBUG symbol.


Disclaimer: http://www.peralex.com/disclaimer.html



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.