Strange, I know. Yet the only way to achieve the desired effect.
I would much rather initialize an array[] with L"bar" instead of a pointer* but it seems the QNX compilers prefer the pointer notation, at least when it comes to wchar strings. Normal character arrays (of char) can be initialized using: char foo[] = “bar”; Just not wchar for some reason.
As far as I can tell, it’s just a peculiarity of the QNX compiler. Perhaps it’s due to the old version of gcc (2.95), or perhaps someone overlooked that aspect.
Regardless, the wchar_t initializers exist on every other platform I’ve tested: Linux, BSD, Solaris, Windows - all work. So I must conclude that QNX is missing something, rather than me.