Boxed copy constructor should not be called, split Boxed into prototype and instance structs
Hi
It seems that GJS fails to compile, on Debian Buster, with 32 bit and 64 bit, AND with GCC 6 7 and 8.
I get the below output, I am not sure where werror is coming from, as I even tried to pull it out of configure.ac with sed in my build scripts
CXX gi/libgjs_la-gtype.lo
CXX gi/libgjs_la-interface.lo
gi/boxed.cpp: In function ‘JSObject* gjs_boxed_from_c_struct(JSContext*, GIStructInfo*, void*, GjsBoxedCreationFlags)’:
gi/boxed.cpp:43:8: error: inlining failed in call to ‘Boxed& Boxed::operator=(const Boxed&)’: call is unlikely and code size would grow [-Werror=inline]
struct Boxed {
^~~~~
gi/boxed.cpp:1161:11: note: called from here
*priv = *proto_priv;
~~~~~~^~~~~~~~~~~~~
CXX gi/libgjs_la-ns.lo
gi/boxed.cpp: In function ‘bool gjs_boxed_constructor(JSContext*, unsigned int, JS::Value*)’:
gi/boxed.cpp:43:8: error: inlining failed in call to ‘Boxed& Boxed::operator=(const Boxed&)’: call is unlikely and code size would grow [-Werror=inline]
struct Boxed {
^~~~~
gi/boxed.cpp:428:11: note: called from here
*priv = *proto_priv;
~~~~~~^~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:2425: gi/libgjs_la-boxed.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/srcbuild/gjs'
make: *** [Makefile:1568: all] Error 2
Thanks
Edited by Philip Chimento