On Thu, 25 May 2023 15:18:41 GMT, Kim Barrett <kbarr...@openjdk.org> wrote:

>> When using the new xlc17 compiler (based on a recent clang) to build OpenJDk 
>> on AIX , we run into various "warnings as errors".
>> Some of those are in shared codebase and could be addressed by small 
>> adjustments.
>> A lot of those changes are in hotspot, some might be somewhere else in the 
>> OpenJDK C/C++ code.
>
> test/jdk/java/io/File/libGetXSpace.c line 128:
> 
>> 126: #else
>> 127:     struct statfs buf;
>> 128:     int result = statfs((char*)chars, &buf);
> 
> Is this working around a bug in IBM's declaration?
> 
> Also, pre-existing, the cast seems really suspicious.  The type of `chars` is 
> `jchar*`, which is a
> sequence of 16bit characters.  Does this actually work?  If so, how?

This is IBMs declaration of statfs
`extern int statfs(char *, struct statfs *);`
So the compiler will not accept a `const char*`
Indeed I do not know if this ever worked, but my change makes it not worse.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14146#discussion_r1205745144

Reply via email to