micmacIGN / micmac

Free open-source photogrammetry software tools
http://micmac.ensg.eu
Other
718 stars 154 forks source link

Compilation error - CPP_MM2DPostSism.cpp #158

Closed zygmuntg closed 3 years ago

zygmuntg commented 4 years ago

While compiling on fresh install of Debian 10.5 i get the following error:

[ 55%] Building CXX object src/CMakeFiles/elise.dir/uti_phgrm/CPP_MM2DPostSism.cpp.o /root/micmac/src/uti_phgrm/CPP_VideoVisage.cpp: In constructor ‘cVideoVisage::cVideoVisage(int, char**)’: /root/micmac/src/uti_phgrm/CPP_VideoVisage.cpp:47:18: error: ‘sprintf’ may write a terminating nul past the end of the destination [-Werror=format-overflow=] sprintf(aBuf,"%05d",aK); ^~ /root/micmac/src/uti_phgrm/CPP_VideoVisage.cpp:47:12: note: ‘sprintf’ output between 6 and 11 bytes into a destination of size 10 sprintf(aBuf,"%05d",aK);


cc1plus: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/elise.dir/build.make:5679: src/CMakeFiles/elise.dir/uti_phgrm/CPP_VideoVisage.cpp.o] Błąd 1
make[2]: *** Oczekiwanie na niezakończone zadania....
make[1]: *** [CMakeFiles/Makefile2:314: src/CMakeFiles/elise.dir/all] Błąd 2
make: *** [Makefile:130: all] Błąd 2
Micmac-test commented 4 years ago

PSLinuxOS with the latest updates has the same problem.

zygmuntg commented 4 years ago

I've changed line 46 in micmac/src/uti_phgrm/CPP_VideoVisage.cpp from char aBuf[10]; to char aBuf[11]; Now it compiles without any problems.

luc-girod commented 3 years ago

Was this fixed in the current state of MicMac? If so, please close the issue.