I recently decided to switch to clang from gcc and I’m getting the following warning for my use of wide character constants: "extraneous characters in wide character constant ignored". Here is the code that gets the warning:
wstring& line;
…
for (wstring::iterator ch = line.begin(); ch != line.end(); ++ch)
switch (*ch) {
case L'│': *ch = L'|'; break;
case L'﹤': *ch = L'<'; break;
case L'﹥': *ch = L'>'; break;
case L'﹙': *ch = L'('; break;
case L'﹚': *ch = L')'; break;
default: break;
}
Here, the characters in the case conditions are all high-unicode characters and therefore seen as multibyte characters by the clang parser, apparently (the source code is UTF-8 encoded).
My question is what is the meaning behind the warning message. That is, what exactly is being ignored. Also, given this warning, will my program work as designed?
gcc does not give any warnings for this code and everything works like a charm.