JDK-6718830 : Hotspot fails to build with gcc 4.3
  • Type: Bug
  • Status: Closed
  • Resolution: Fixed
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P3
  • Affected Version: 7
  • OS: linux
  • CPU: generic
  • Submit Date: 2008-06-25
  • Updated Date: 2012-10-08
  • Resolved Date: 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 Availabitlity Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u14Fixed 7Fixed
Description
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 17.4.1.2 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.

Comments
EVALUATION http://hg.openjdk.java.net/jdk6/jdk6/hotspot/rev/564269902fe3
2009-05-09

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