Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile Warnings in app_sqlang #2400

Closed
joshelson opened this issue Jul 14, 2020 · 1 comment
Closed

Compile Warnings in app_sqlang #2400

joshelson opened this issue Jul 14, 2020 · 1 comment

Comments

@joshelson
Copy link

Description

Handful of new compile warnings popped up with Kamailio 5.3.5.

Reproduction

Compile warnings:

CC (gcc) [M app_sqlang.so]		app_sqlang_mod.o
make --no-print-directory -C ./squirrel/squirrel SQMARCH64="-m64" CC_EXTRA_FLAGS="-fPIC" \
	OUT="../../libsquirrel.a" sq64
gcc -O2 -m64 -D_SQ64 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c sqapi.cpp sqbaselib.cpp sqfuncstate.cpp sqdebug.cpp sqlexer.cpp sqobject.cpp sqcompiler.cpp sqstate.cpp sqtable.cpp sqmem.cpp sqvm.cpp sqclass.cpp -I../include -I. -Iinclude -fPIC
In file included from sqobject.h:5,
                 from sqpcheader.h:17,
                 from sqapi.cpp:4:
squtils.h: In instantiation of 'void sqvector<T>::remove(SQUnsignedInteger) [with T = SQObjectPtr; SQUnsignedInteger = long long unsigned int]':
sqarray.h:83:27:   required from here
squtils.h:97:20: warning: 'void* memmove(void*, const void*, size_t)' writing to an object of type 'struct SQObjectPtr' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
   97 |             memmove(&_vals[idx], &_vals[idx+1], sizeof(T) * (_size - idx - 1));
      |             ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from sqpcheader.h:17,
                 from sqapi.cpp:4:
sqobject.h:205:8: note: 'struct SQObjectPtr' declared here
  205 | struct SQObjectPtr : public SQObject
      |        ^~~~~~~~~~~
In file included from sqobject.h:5,
                 from sqpcheader.h:17,
                 from sqbaselib.cpp:4:
squtils.h: In instantiation of 'void sqvector<T>::remove(SQUnsignedInteger) [with T = SQObjectPtr; SQUnsignedInteger = long long unsigned int]':
sqarray.h:83:27:   required from here
squtils.h:97:20: warning: 'void* memmove(void*, const void*, size_t)' writing to an object of type 'struct SQObjectPtr' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
   97 |             memmove(&_vals[idx], &_vals[idx+1], sizeof(T) * (_size - idx - 1));
      |             ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from sqpcheader.h:17,
                 from sqbaselib.cpp:4:
sqobject.h:205:8: note: 'struct SQObjectPtr' declared here
  205 | struct SQObjectPtr : public SQObject
      |        ^~~~~~~~~~~
In file included from sqobject.h:5,
                 from sqpcheader.h:17,
                 from sqobject.cpp:4:
squtils.h: In instantiation of 'void sqvector<T>::remove(SQUnsignedInteger) [with T = SQObjectPtr; SQUnsignedInteger = long long unsigned int]':
sqarray.h:83:27:   required from here
squtils.h:97:20: warning: 'void* memmove(void*, const void*, size_t)' writing to an object of type 'struct SQObjectPtr' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
   97 |             memmove(&_vals[idx], &_vals[idx+1], sizeof(T) * (_size - idx - 1));
      |             ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from sqpcheader.h:17,
                 from sqobject.cpp:4:
sqobject.h:205:8: note: 'struct SQObjectPtr' declared here
  205 | struct SQObjectPtr : public SQObject
      |        ^~~~~~~~~~~
In file included from sqobject.h:5,
                 from sqpcheader.h:17,
                 from sqstate.cpp:4:
squtils.h: In instantiation of 'void sqvector<T>::remove(SQUnsignedInteger) [with T = SQObjectPtr; SQUnsignedInteger = long long unsigned int]':
sqarray.h:83:27:   required from here
squtils.h:97:20: warning: 'void* memmove(void*, const void*, size_t)' writing to an object of type 'struct SQObjectPtr' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
   97 |             memmove(&_vals[idx], &_vals[idx+1], sizeof(T) * (_size - idx - 1));
      |             ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from sqpcheader.h:17,
                 from sqstate.cpp:4:
sqobject.h:205:8: note: 'struct SQObjectPtr' declared here
  205 | struct SQObjectPtr : public SQObject
      |        ^~~~~~~~~~~
In file included from sqobject.h:5,
                 from sqpcheader.h:17,
                 from sqvm.cpp:4:
squtils.h: In instantiation of 'void sqvector<T>::remove(SQUnsignedInteger) [with T = SQObjectPtr; SQUnsignedInteger = long long unsigned int]':
sqarray.h:83:27:   required from here
squtils.h:97:20: warning: 'void* memmove(void*, const void*, size_t)' writing to an object of type 'struct SQObjectPtr' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
   97 |             memmove(&_vals[idx], &_vals[idx+1], sizeof(T) * (_size - idx - 1));
      |             ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from sqpcheader.h:17,
                 from sqvm.cpp:4:
sqobject.h:205:8: note: 'struct SQObjectPtr' declared here
  205 | struct SQObjectPtr : public SQObject
      |        ^~~~~~~~~~~
ar rc ../../libsquirrel.a *.o
rm *.o
make --no-print-directory -C ./squirrel/sqstdlib SQMARCH64="-m64" CC_EXTRA_FLAGS="-fPIC" \
	OUT="../../libsqstdlib.a" sq64
gcc -O2 -m64 -fno-exceptions -D_SQ64 -fno-rtti -Wall -fno-strict-aliasing -c sqstdblob.cpp sqstdio.cpp sqstdstream.cpp sqstdmath.cpp sqstdsystem.cpp sqstdstring.cpp sqstdaux.cpp sqstdrex.cpp -I../include -I. -Iinclude -fPIC
ar rc ../../libsqstdlib.a *.o
rm *.o

Debugging Data

Operating System:

Alpine Linux Latest

@miconda
Copy link
Member

miconda commented Jul 14, 2020

These are in the files of the squirrel interpreter that are embedded in Kamailio. They should be fixed upstream, we do not plan to diverge from the original project as those files are periodically sync'ed.

They should be reported to squirrel interpreter project:

If people find those warnings annoying, given also that app_sqlang is likely not used very much, the module can be moved to excludes modules, so it is not compiled by default.

@miconda miconda closed this as completed Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants