最近调试程序的时候遇到一个奇怪的 Warning ,查了一会才找到原因:
c:\edk\AppPkg\Applications\C4066\C4066.c(17) : warning C4066: characters beyond first in wide-character constant ignored
int EFIAPI main ( IN int Argc, IN CHAR16 **Argv ) { Print(L'[%d]',2015); return EFI_SUCCESS; }
错误产生的原因是:把双引号写成了单引号,编译器以为你要定义一个 CHAR16 的字符,所以要忽略一些东西。修改的方法是,改成双引号即可。
参考:
1.https://msdn.microsoft.com/en-us/library/aa748819(v=vs.60).aspx
Compiler Warning (level 3) C4066
Visual Studio 6.0
characters beyond first in wide-character constant ignored
The compiler processes only the first character of a wide-character constant.