Oracle Blog

making everything ok

Some Kerberos Compiler Warnings on Windows

There is a rather old bug on native code compiler warnings on Windows. I have been the responsible engineer for some time but never really started working on it. Unfortunately, some warnings result in a real runtime error now. Sorry.

As you can see, we used the swprintf function in a not-so-standard way. The correct signature of the function is swprintf(buffer, size, format, args...) but we didn't provide the size argument. In the age of VC++ 2003, there were already warnings, but the runtime accepted this "overloaded" form and it ran fine. Starting from jdk7b108, we start using VC++ 2010 to build jdk7, the same warnings still show, but this time the runtime does not accept the form anymore, and a JVM crash is observed.

The lesson is never ignore compiler warnings.

The fix would be integrated in jdk7 builds in several weeks, and I've uploaded a copy here (32 bit build) in case anyone wants to try it out. I build it in a VirtualBox guest and hope it contains no virus.