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


_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to