Search code examples
cwindows-phone-8c99

Using C99 code as a Windows Phone Runtime Component (compiling with /ZW)


I've cleaned and compiled successfully on ARM a portable program that has been coded in C99. Any of my source file fails to compile using /ZW.

All that Visual Studio is telling me is that I can't compile my files with /ZW.

Is this possible to use C99 code as a Runtime Component?

What makes a file compile or not with /ZW?


Solution

  • Current versions of MSVC are not C99 compilers — though that may change in the future as it supports C11 and therefore, of necessity, some parts of C99 too.

    At the moment, though, you will have to remove any coding practices that rely on C99 before porting to MSVC. Also note that the behaviour of _snprintf() in the Microsoft runtime is not the same as the behaviour required by C99 for snprintf() (and the renaming is another problem in its own right). There are also differences between some of the 'safer' functions defined as optional in C11 in Annex K (Bounds checking interfaces) and the Microsoft runtime versions of the functions with the same name. See also Do you use the TR 24731 'safe' functions.