nasa / trick

Trick Simulation Environment. Trick provides a common set of simulation capabilities and utilities to build simulations automatically.
Other
34 stars 19 forks source link

Python SWIG warning at the end of the sim compile #1568

Closed dandexter closed 4 months ago

dandexter commented 1 year ago

The simulation compiles and at the end when Trick is doing cleanup and compile the Python modules I get this unexpected Python SWIG warning.

OS: Red Hat Enterprise Linux release 8.8 (Ootpa) and Rocky Linux release 8.8 (Green Obsidian) Compiler: gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-18.0.2) and gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-18) Trick: Latest from repo compiled and installed using Trick documentation.

/usr/bin/g++ -I/home/ddexter/projects/TrickHLA/include -I/home/ddexter/projects/TrickHLA/models -DIEEE_1516_2010 -I/home/ddexter/rti/pRTI1516e_v5.5.7.0/include -I. -Wno-deprecated-declarations -DTHLA_CHECK_SEND_AND_RECEIVE_COUNTS -DTHLA_CYCLIC_READ_TIME_STATS -O3 -isystem/home/ddexter/projects/trick/trick_source -isystem/home/ddexter/projects/trick/include -isystem/home/ddexter/projects/trick/include/trick/compat -DTRICK_VER=19 -DTRICK_MINOR=7 -fpic -I/usr/include/udunits2 -DUSE_ER7_UTILS_INTEGRATORS -I../include -isystem/usr/include/python3.6m -isystem/usr/include/python3.6m -Wno-shadow -Wno-missing-field-initializers -Wno-unused-but-set-variable -Wno-maybe-uninitialized -Wno-cast-function-type -Wno-unused-parameter -c -o build/top.o build/top.cpp Compiling Python modules Zipping Python modules into trick.zip /usr/bin/python3 -m compileall -q .trick ln -sf .trick trick zip -rq trick.zip trick rm -f trick build/top.cpp: In function ‘void SWIG_Python_addvarlink(PyObject, char, PyObject ()(), int ()(PyObject))’: build/top.cpp:5995:16: warning: ‘char strncpy(char, const char*, size_t)’ specified bound depends on the length of the source argument [-Wstringop-overflow=] strncpy(gv->name,name,size);


build/top.cpp:5992:27: note: length computed here
       size_t size = strlen(name)+1;
                     ~~~~~~^~~~~~
 /usr/bin/g++ -o S_main_Linux_8.5_x86_64.exe -Wl,--export-dynamic build/S_source.o @build/model_link_list @build/io_link_list @build/py_link_list  -L/home/ddexter/rti/pRTI1516e_v5.5.7.0/jre/lib/server/.. -L/home/ddexter/rti/pRTI1516e_v5.5.7.0/jre/lib/server -ljava -ljvm -lverify -Wl,-rpath,/home/ddexter/rti/pRTI1516e_v5.5.7.0/jre/lib/server/.. -Wl,-rpath,/home/ddexter/rti/pRTI1516e_v5.5.7.0/jre/lib/server -L/home/ddexter/rti/pRTI1516e_v5.5.7.0/lib/gcc73_64 -lrti1516e64 -lfedtime1516e64 -Wl,-rpath,/home/ddexter/rti/pRTI1516e_v5.5.7.0/lib/gcc73_64  -Wl,-whole-archive -Wl,-rpath=/home/ddexter/projects/trick/lib64 -L/home/ddexter/projects/trick/lib64 -ltrick -ltrick_pyip -ltrick_comm -ltrick_math -ltrick_units -ltrick_mm -ltrick_connection_handlers -ler7_utils -Wl,-no-whole-archive  -L/usr/lib64 -lpython3.6m -lpthread -ldl  -lutil -lm  -Xlinker -export-dynamic -lpython3.6m -lpthread -ldl  -lutil -lm    -ludunits2 -lrt -lm -ldl
 /home/ddexter/projects/trick/libexec/trick/sie_concat
ddj116 commented 1 year ago

Looks like same core issues as #1565

hchen99 commented 5 months ago

Tested on rocky8, gcc 8.5.0, swig 3.0.2, and clang 16. I didn't see the warning. #1565 confirmed it's no longer an issue with newer clang and was closed. Please let us know if this is still an issue for you.

sharmeye commented 4 months ago

No further activity, closing it down.