Erik .. please chime in if you disagree with the following The goal here is to have no warnings with the *official* compilers. If you are using something else and get warnings then either fix the *source* or else you need to use --disable-warning-as-errors.
Otherwise we'll be suppressing the warnings for a whole range of compilers and no one will know what the set is and these bugs will become 'unfixable' and a continual chore of churn. It will be something we should address as we move *official* compilers. In fact the warning you want to suppress is one I just got rid of (the suppression) http://hg.openjdk.java.net/jdk9/client/jdk/rev/d4f7412a51d2 I don't think we want to add it back unless the *official* compilers object .. I am sure that official list is documented somewhere. -phil. On 8/23/16, 6:10 AM, Yasumasa Suenaga wrote: > Hi all, > > I've fixed several warnings when we build OpenJDK with GCC 6 in > JDK-8160294. > However, I encountered shift-negative-value warnings at jdhuff.c on my > Fedora 24 (GCC 6.1.1): > -------------- > /home/ysuenaga/OpenJDK/hs/jdk/src/java.desktop/share/native/libjavajpeg/jdhuff.c:458:13: > warning: left shift of negative value [-Wshift-negative-value] > { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, > ^~ > /home/ysuenaga/OpenJDK/hs/jdk/src/java.desktop/share/native/libjavajpeg/jdhuff.c:458:28: > warning: left shift of negative value [-Wshift-negative-value] > { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, > ^~ > /home/ysuenaga/OpenJDK/hs/jdk/src/java.desktop/share/native/libjavajpeg/jdhuff.c:458:43: > warning: left shift of negative value [-Wshift-negative-value] > { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, > : > -------------- > > I think these warnings are available from JDK-8074827. > This issue enables warnings to fix in the source code. > However, in review of JDK-8160294, I heared that warnings in IJG JPEG > library should just be suppressed: > > http://mail.openjdk.java.net/pipermail/jdk9-dev/2016-June/004497.html > > > So I think they should be suppressed and we should fix as below: > -------------- > diff -r b548b8217d8c make/lib/Awt2dLibraries.gmk > --- a/make/lib/Awt2dLibraries.gmk Mon Aug 22 19:28:36 2016 -0700 > +++ b/make/lib/Awt2dLibraries.gmk Tue Aug 23 22:08:44 2016 +0900 > @@ -490,7 +490,7 @@ > CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBJAVAJPEG_HEADERS) \ > $(LIBJAVA_HEADER_FLAGS) \ > -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \ > - DISABLED_WARNINGS_gcc := clobbered, \ > + DISABLED_WARNINGS_gcc := clobbered shift-negative-value, \ > MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers, \ > LDFLAGS := $(LDFLAGS_JDKLIB) \ > $(call SET_SHARED_LIBRARY_ORIGIN), \ > -------------- > > If it is correct, I file it to JBS and upload webrev. > Do you think about it? > > > Thanks, > > Yasumasa > >