[llvm-bugs] Why utf convertion functions requires output buffer to be empty?

Xpol Wan via llvm-bugs llvm-bugs at lists.llvm.org
Thu Nov 19 21:49:55 PST 2015


The function convertUTF16ToUTF8String and convertUTF8ToUTF16String defined
in lib/Support/ConvertUTFWrapper.cpp has an assertion that out buffer
should be empty.

But why is these assertion necessary?

see:

https://github.com/llvm-mirror/llvm/blob/master/lib/Support/ConvertUTFWrapper.cpp#L85
https://github.com/llvm-mirror/llvm/blob/master/lib/Support/ConvertUTFWrapper.cpp#L135

Best Regards!

Xpol Wan
// There is a better way!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20151120/58d17f72/attachment.html>


More information about the llvm-bugs mailing list