How to address this instance of C4428 Visual C++ warning about a character literal?

廉价感情. 提交于 2019-12-02 04:33:52

问题


Currently Visual C++ issues C4428 warning

universal-character-name encountered in source

on the following code

const wchar_t someMagicValue = L'\ufffd';

I'd like to address this warning and I wonder whether the following:

const wchar_t someMagicValue = L'\xfffd';

will be fully equivalent code.

Will the latter code be fully equivalent to the former? What could be a better option?


回答1:


As commented here

Compiler Warning (level 4) C4428 (VS2010)

this is most likely /just a bug/ in MSVC

See also this thread for a bit more discussion




回答2:


Have you tried this?

const wchar_t someMagicValue = 0xfffd;


来源:https://stackoverflow.com/questions/7078013/how-to-address-this-instance-of-c4428-visual-c-warning-about-a-character-liter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!