On Mon, 22 Jan 2024 08:59:30 GMT, Kim Barrett <kbarr...@openjdk.org> wrote:

> I don't think `#pragma GCC poison` works for us. It would complain about a
> system or library header that uses NULL and is included after the pragma.

I see, that's a shame in that case



> However, there are still a lot of NULL's left. All of the per-cpu .ad files, 
> and the jvmtiXXX.xsl files contain NULL's that will appear in the associated 
> generated code. Also, NULL usage in gtests doesn't seem to have been 
> addressed yet.
> 
> But it does look like there's been a bit of backsliding: 
> https://bugs.openjdk.org/browse/JDK-8324286

That's a little worrying, maybe the Style Guide's NULL section could be 
reworded since now most usages of NULL are nullptr? The .ad files and .xsl 
files are a bit of a problem though



> MSVC's deprecation pragma might work for this, at least for shared and
> Windows-specific code. I couldn't find a way to use it for FORBID_C_FUNCTION,
> but the problems I encountered for that don't seem applicable in this case.

The deprecation pragma only works for macros and identifiers, it doesn't accept 
method signatures and would warn for every time a identifier is used, even in 
the method's declaration itself! Probably can't be used in FORBID_C_FUNCTION as 
mentioned above, but sounds good for a macro like NULL

I've also been trying to implement FORBID_C_FUNCTION and ALLOW_C_FUNCTION 
portably, speaking of it, but it hasn't been going great so far :/ 
https://github.com/openjdk/jdk/pull/17387

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

PR Comment: https://git.openjdk.org/jdk/pull/14198#issuecomment-1903579473

Reply via email to