yocontra / node-gdal-next

Node.js bindings for GDAL (Geospatial Data Abstraction Library) [Fork]
https://contra.io/node-gdal-next/
Apache License 2.0
75 stars 35 forks source link

fix the memcpy warning in nan_weak.h #23

Closed mmomtchev closed 3 years ago

mmomtchev commented 3 years ago

As much as I hate this fix, there is simply no solution to that horrible line in nan_weak.h

https://github.com/nodejs/nan/blob/8e4603d00fcbb5069b04da1368939d885163e2ce/nan_weak.h#L58

Basically, Persistent<T> has an implicit non copyable trait, that is there for a reason, and nan works around that "problem" by memcpy-ing the object. G++ 8 is smart enough to detect this and throw a warning. It is a fundamental issue that cannot be solved without modifying V8.