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.

Here is the changeset for it.

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.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blog has a comments managing system that requires me to approve each comment manually. Please do not re-post and I will reply it (if I have an answer) when I get pinged.

Search

Top Tags
Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today