8204967: Resolve disabled warnings for libunpack

Fixed warnings for libunpack

Reviewed-by: jlaskey
This commit is contained in:
Srinivas Dama 2018-06-28 19:44:58 +05:30
parent b5f1b1e0a3
commit a57b47dafc
3 changed files with 11 additions and 4 deletions
make/launcher
src/jdk.pack/share/native/common-unpack

@ -90,7 +90,6 @@ $(eval $(call SetupJdkExecutable, BUILD_UNPACKEXE, \
CFLAGS_linux := -fPIC, \
CFLAGS_solaris := -KPIC, \
CFLAGS_macosx := -fPIC, \
DISABLED_WARNINGS_gcc := unused-result implicit-fallthrough, \
LDFLAGS := $(UNPACKEXE_ZIPOBJS) \
$(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
$(call SET_SHARED_LIBRARY_ORIGIN), \

@ -1799,6 +1799,7 @@ unpacker::attr_definitions::parseLayout(const char* lp, band** &res,
case 'B': case 'H': case 'I': case 'V': // unsigned_int
case 'S': // signed_int
--lp; // reparse
/* fall through */
case 'F':
lp = parseIntLayout(lp, b, EK_INT);
break;
@ -3709,7 +3710,7 @@ const char* entry::string() {
case CONSTANT_Signature:
if (value.b.ptr == null)
return ref(0)->string();
// else fall through:
/* fall through */
case CONSTANT_Utf8:
buf = value.b;
break;
@ -4216,6 +4217,7 @@ void unpacker::write_bc_ops() {
case _invokeinit_self_option: classRef = thisClass; break;
case _invokeinit_super_option: classRef = superClass; break;
default: assert(bc == _invokeinit_op+_invokeinit_new_option);
/* fall through */
case _invokeinit_new_option: classRef = newClass; break;
}
wp[-1] = origBC; // overwrite with origBC

@ -579,8 +579,14 @@ static jlong read_input_via_gzip(unpacker* u,
fseek(u->infileptr, -TRAILER_LEN, SEEK_END);
uint filecrc;
uint filelen;
fread(&filecrc, sizeof(filecrc), 1, u->infileptr);
fread(&filelen, sizeof(filelen), 1, u->infileptr);
if (fread(&filecrc, sizeof(filecrc), 1, u->infileptr) != 1) {
fprintf(u->errstrm, "Error:reading CRC information on input file failed err=%d\n",errno);
exit(1);
}
if (fread(&filelen, sizeof(filelen), 1, u->infileptr) != 1) {
fprintf(u->errstrm, "Error:reading file length on input file failed err=%d\n",errno);
exit(1);
}
filecrc = SWAP_INT(filecrc);
filelen = SWAP_INT(filelen);
if (u->gzin->gzcrc != filecrc ||