Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6778669
Votes 0
Synopsis Patch from Red Hat -- fixes compilation errors
Category hotspot:compiler2
Reported Against
Release Fixed hs15(b03), 7(b51) (Bug ID:2174487)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs
Submit Date 02-DEC-2008
Description
Submitted by Lilian Angel.

--- openjdk/hotspot/src/share/vm/adlc/adlc.hpp.ark      2008-01-11 14:15:41.000000000 +0000
+++ openjdk/hotspot/src/share/vm/adlc/adlc.hpp  2008-01-11 14:16:14.000000000 +0000
@@ -32,7 +32,7 @@
 // standard library constants
 #include "stdio.h"
 #include "stdlib.h"
-#if _MSC_VER >= 1300  // Visual C++ 7.0 or later
+#if (defined(__GNUC__) && __GNUC__ >= 3) || (_MSC_VER >= 1300)  // gcc 3.0 or later or Visual C++ 7.0 or later
 #include <iostream>
 #else
 #include <iostream.h>
--- openjdk/hotspot/src/share/vm/adlc/filebuff.cpp.ark  2008-01-11 14:17:17.000000000 +0000
+++ openjdk/hotspot/src/share/vm/adlc/filebuff.cpp      2008-01-11 14:17:34.000000000 +0000
@@ -28,6 +28,8 @@
 // FILEBUFF.CPP - Routines for handling a parser file buffer
 #include "adlc.hpp"

+using namespace std;
+
 //------------------------------FileBuff--------------------------------------- // Create a new parsing buffer
 FileBuff::FileBuff( BufferedFile *fptr, ArchDesc& archDesc) : _fp(fptr), _AD(archDesc) {
--- openjdk/hotspot/src/share/vm/adlc/filebuff.hpp.ark  2008-01-11 14:14:45.000000000 +0000
+++ openjdk/hotspot/src/share/vm/adlc/filebuff.hpp      2008-01-11 14:15:34.000000000 +0000
@@ -27,7 +27,7 @@

 // FILEBUFF.HPP - Definitions for parser file buffering routines

-#if _MSC_VER >= 1300  // Visual C++ 7.0 or later
+#if (defined(__GNUC__) && __GNUC__ >= 3) || (_MSC_VER >= 1300)  // gcc 3.0 or later, or Visual C++ 7.0 or later
 #include <iostream>
 #else
 #include <iostream.h>
@@ -99,8 +99,11 @@
   FileBuffRegion *copy();                   // Deep copy
   FileBuffRegion *merge(FileBuffRegion*); // Merge 2 regions; delete input

-//  void print(std::ostream&);
-//  friend std::ostream& operator<< (std::ostream&, FileBuffRegion&);
+#if defined(__GNUC__) && __GNUC__ >= 3
+  void print(std::ostream&);
+  friend std::ostream& operator<< (std::ostream&, FileBuffRegion&);
+#else
   void print(ostream&);
   friend ostream& operator<< (ostream&, FileBuffRegion&);
+#endif
 };
--- openjdk/hotspot/build/linux/makefiles/gcc.make.ark  2008-01-11 14:24:05.000000000 +0000
+++ openjdk/hotspot/build/linux/makefiles/gcc.make      2008-01-11 14:24:27.000000000 +0000
@@ -94,7 +94,8 @@
 endif

 # Compiler warnings are treated as errors
-WARNINGS_ARE_ERRORS = -Werror
+# Commented out for now because of gcc 4.3 warnings OpenJDK isn't ready for
+#WARNINGS_ARE_ERRORS = -Werror
 # Except for a few acceptable ones
 ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare
 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS)
--- openjdk/hotspot/build/solaris/makefiles/gcc.make.ark        2008-01-11 14:24:33.000000000 +0000
+++ openjdk/hotspot/build/solaris/makefiles/gcc.make    2008-01-11 14:24:48.000000000 +0000
@@ -109,7 +109,8 @@


 # Compiler warnings are treated as errors
-WARNINGS_ARE_ERRORS = -Werror
+# Commented out for now because of gcc 4.3 warnings OpenJDK isn't ready for
+# WARNINGS_ARE_ERRORS = -Werror
 # Enable these warnings. See 'info gcc' about details on these options
 ADDITIONAL_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare
 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ADDITIONAL_WARNINGS)
--- openjdk/jdk/make/common/Defs-linux.gmk.ark  2008-01-11 14:20:26.000000000 +0000
+++ openjdk/jdk/make/common/Defs-linux.gmk      2008-01-11 14:21:10.000000000 +0000
@@ -139,7 +139,9 @@
 # Treat compiler warnings as errors, if warnings not allowed
 #
 ifeq ($(COMPILER_WARNINGS_FATAL),true)
-  GCC_WARNINGS += -Werror
+  # gcc 4.3 introduces new warnings OpenJDK code isn't quite ready for, such as+  # "cast from double to float may chance its value". Let's ignore this for now.
+  # GCC_WARNINGS += -Werror
 endif

 #
Posted Date : 2008-12-02 19:12:55.0

The original author is Lilian Angel   xxxxx@xxxxx  
Posted Date : 2008-12-02 19:10:06.0
Work Around
N/A
Evaluation
The conditional include of <iostream> is already fixed in the codebase, it only includes <iostream> anymore.

The std namespace in filebuff.cpp seems useful.

The commented methods in FileBuffRegion which use std::, which are used conditionally in the Red Hat patch, are superfluous when using std namespace and can be removed.

Furthermore I tried to replace the -w GCC flag with -Werror and only hit one warning which is trivial to fix.  I think we should use -Werror for ADLC too, as we do for HotSpot.
Posted Date : 2009-02-04 15:44:50.0

http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/dbbe28fc66b5
Posted Date : 2009-02-27 14:17:20.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang