RFR : 8227737: avoid implicit-function-declaration on AIX

Baesken, Matthias matthias.baesken at sap.com
Tue Jul 16 15:04:19 UTC 2019


Hello, please review the following  AIX related change .
It fixes a number of  missing inclusions  leading to  implicit-function-declaration  warnings when compiling  with the recent xlc16 /xlclang .


At various places in the native C coding in jdk, we miss header inclusions on AIX.
This leads to warnings like :

/nightly/jdk/src/java.base/unix/native/libjava/childproc.c:99:5: warning: implicitly declaring library function 'snprintf'
with type 'int (char *, unsigned long, const char *, ...)' [-Wimplicit-function-declaration]
    snprintf(aix_fd_dir, 32, "/proc/%d/fd", getpid());
    ^
/nightly/jdk/src/java.base/unix/native/libjava/childproc.c:99:5: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf'

or

/nightly/jdk/src/java.base/aix/native/libjli/java_md_aix.c:38:5: warning: implicitly declaring library function 'memset'
with type 'void *(void *, int, unsigned long)' [-Wimplicit-function-declaration]
    memset((void *)info, 0, sizeof(Dl_info));

/nightly/jdk/src/java.base/aix/native/libjli/java_md_aix.c:38:5: note: include the header <string.h> or explicitly provide a declaration for 'memset'



Bug/webrev :

https://bugs.openjdk.java.net/browse/JDK-8227737

http://cr.openjdk.java.net/~mbaesken/webrevs/8227737.0/


Thanks, Matthias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20190716/5e108503/attachment-0001.html>


More information about the net-dev mailing list