How do I initialize a variable of type napi_value to NULL to avoid compiler warnings
sharadraju opened this issue · 4 comments
sharadraju commented
We use node-addon-api code for our Node.js driver (oracledb) for Oracle Database.
We are facing some compiler warnings for uninitialized napi_value
type variable. Can I initialize a variable of type napi_value
to NULL?
KevinEady commented
You should just be able to napi_value foo = nullptr;
but nullptr is not a valid value (ie. it is not the same as JavaScript null
) so do not pass this nullptr to Node-API functions.
sharadraju commented
Thanks @KevinEady. Let me try that
KevinEady commented
Closing due to inactivity. Let us know if you need more help.
sharadraju commented
Yes, we found the solution for this. Thanks @KevinEady for helping.