Should we rename os:: functions that are named like standard C- or Posix-functions?
Kim Barrett
kim.barrett at oracle.com
Sun Jul 3 20:59:22 UTC 2022
> On Jul 3, 2022, at 4:47 AM, Thomas Stüfe <thomas.stuefe at gmail.com> wrote:
>
> I am preparing a patch to forbid C-heap allocation functions in hotspot as you proposed (https://github.com/openjdk/jdk/pull/9356).
>
> Interestingly, not all occurrences of forbidden functions are found everywhere. I found that if I compile on Ubuntu 20.04 with gcc 10.3., it does not complain about "realpath" even though I forbade it. If I build on Alpine, gcc 10.3.1, it finds occurrences of realpath.
In which build variants? All? Or only fastdebug? If the latter, this might be another case of
_FORTIFY_SOURCE rewriting the call first, dodging the warning. This is mentioned in the
comment describing the gcc implementation of FORBID_C_FUNCTION.
Note also that I didn’t find a way to provide this feature for Windows/VisualStudio, and the
clang implementation didn’t get tested by me. (Oracle only uses clang when building for
MacOS using Xcode, and no released version of Xcode has a sufficiently recent version
of clang to have the needed feature set.)
More information about the hotspot-dev
mailing list