RFR 9: 8074818: Resolve disabled warnings for libjava

Roger Riggs Roger.Riggs at Oracle.com
Wed May 27 02:52:07 UTC 2015


Sadly, but not entirely unexpectedly there is an anomaly in the include 
It seems that Windows does not define O_SYNC and O_DSYNC.
To make up for the absence jdk/src/java.base/share/native/libjava/io_util.h
conditionally defines them.  There is no problem if the system include 
files appear
first, but  in the other order, fcntl.h tries to re-define it.
In the recommended order, there is no issue.


On 5/22/15 1:47 PM, Martin Buchholz wrote:
> It's a good idea to order include statements by system dependencies, 
> jdk dependencies, implementation helpers, BUT order of include 
> statements should never ever matter.  If it does, then we have a bug 
> that should be fixed.  Every header file should be independently 
> includable, and C files should only Include What They Use.  It would 
> be good for us to test some of that, e.g. can you compile each .h file 
> as its own translation unit?
> +#include <fcntl.h>
> +#include <limits.h>
> +
>  #include "jni.h"
>  #include "jni_util.h"
>  #include "jlong.h"
> @@ -32,9 +35,6 @@
>  #include "java_io_FileInputStream.h"
> -#include <fcntl.h>
> -#include <limits.h>
> -

More information about the core-libs-dev mailing list