String literals, ASCII vs UTF-8

Stephan Bergmann sbergman at redhat.com
Wed Feb 29 02:58:01 PST 2012


On 02/29/2012 10:57 AM, Michael Meeks wrote:
> 	Having said all this - I think we can agree that if we are calling this
> new 'createFromAscii_WithLength' method - which is (currently) only
> called during these magic constructors for compile time constants, that
> the chance of having a 4Gb compile-time constant string in the source is
> somewhat minimal ;-) and that there is certainly no need to throw an
> exception and bloat the call-sites for this case at least.

I don't really think we can agree here.  ;)  As long as the "bloat" is 
only alleged, I see no reason to abandon clean coding practices (i.e., 
checking C function return values for error indicators).  If you are 
unhappy with "throw std::bad_alloc;", maybe we can settle for 
"std::abort();" instead?

Stephan


More information about the LibreOffice mailing list