JDK-6718830 : Hotspot fails to build with gcc 4.3
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2008-06-25
  • Updated: 2012-10-08
  • Resolved: 2008-07-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u14Fixed 7Fixed hs14Fixed
Reading the release notes of gcc 4.3 at http://gcc.gnu.org/gcc-4.3/porting_to.html will give you a little bit surprise about how significant the gcc community has done.

An example.

#include <iostream.h>

int main()
  cout << "I'm too old" << endl;
  return 0;

Compiling with previous compilers gives:

warning: #warning This file includes at least one deprecated or
antiquated header. Please consider using one of the 32 headers found
in section of the C++ standard. Examples include substituting
the <X> header for the <X.h> header for C++ includes, or
<iostream> instead of the deprecated header
<iostream.h>. To disable this warning use -Wno-deprecated.

But now says:

error: iostream.h: No such file or directory
In function 'int main()':
6: error: 'cout' was not declared in this scope
6: error: 'endl' was not declared in this scope

Hotspot code includes "*.h" version almost everywhere, so we have to change our code to meet the upcoming change of gcc.

EVALUATION http://hg.openjdk.java.net/jdk6/jdk6/hotspot/rev/564269902fe3

EVALUATION Fix includes two parts: 1. Remove "-Wconversion" to avoid downcast warnings. 2. Use "#include <iostream>" in our adlc code.