RFR: 8204967: Resolve disabled warnings for libunpack

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Thu Jun 14 09:53:21 UTC 2018


On 2018-06-13 18:57, Srinivas Dama wrote:
> Hi,
>
> Please review http://cr.openjdk.java.net/~sdama/8204967/webrev.00/
> for https://bugs.openjdk.java.net/browse/JDK-8204967

Hi Srinivas,

In src/jdk.pack/share/native/common-unpack/zip.cpp, you just read and 
discard the return value from fread to hide the warning. But the purpose 
of the warning is to point out that this kind of code is incorrect. The 
proper fix would be to check the return code from fread to make sure 
that the read did not fail. Otherwise you're just making it impossible 
for the compiler to point out the badly written code, and if you're not 
going to fix this properly, it's better to keep the warning (that way we 
know the code is fishy).

/Magnus

>
> Regards,
> Srinivas



More information about the core-libs-dev mailing list