node icon indicating copy to clipboard operation
node copied to clipboard

Compiler error running on Node 20.12 (works in 20.11.6) in napi-intl.h when calling napi_status napi_create_external_buffer

Open mylowillem opened this issue 10 months ago • 2 comments

Version

20.12

Platform

Windows and OSX

Subsystem

napi-intl.h

What steps will reproduce the bug?

Line 2680 in file napi-intl.h

How often does it reproduce? Is there a required condition?

always it's a compiler error

What is the expected behavior? Why is that the expected behavior?

The code compiles in node 20.11.2 so I expect it to compile in node 20.12

What do you see instead?

Severity Code Description Project Line Suppression State Details File Error C2664 'napi_status napi_create_external_buffer(napi_env,size_t,void *,node_api_nogc_finalize,void *,napi_value *)': cannot convert argument 4 from 'void (__cdecl *)(napi_env,void *,void *) noexcept' to 'node_api_nogc_finalize' binary_encoder 2680 C:\git\cloud\node_modules\node-addon-api\napi-inl.h

Additional information

Compiler errors on both OSX and Windows. Haven't tested on Linux

Severity Code Description Project Line Suppression State Details File Error C2664 'napi_status napi_create_external_buffer(napi_env,size_t,void *,node_api_nogc_finalize,void *,napi_value *)': cannot convert argument 4 from 'void (__cdecl *)(napi_env,void *,void *) noexcept' to 'node_api_nogc_finalize' binary_encoder 2680 C:\git\cloud\node_modules\node-addon-api\napi-inl.h

mylowillem avatar Apr 29 '24 20:04 mylowillem

cc @nodejs/node-api

richardlau avatar Apr 30 '24 14:04 richardlau

Hi @mylowillem ,

Are you using NAPI_EXPERIMENTAL? If so, please check this comment on a similar issue: https://github.com/nodejs/node/issues/52229#issuecomment-2040131493 If not, please state the same here, and we'll look further.

KevinEady avatar Apr 30 '24 15:04 KevinEady