This repository was archived by the owner on Jan 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 191
This repository was archived by the owner on Jan 2, 2021. It is now read-only.
error: ‘char* strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying 4 bytes from a string of the same length [-Werror=stringop-truncation] #297
Copy link
Copy link
Open
Description
mkdir -p build
cmake -Bbuild -H. -G Ninja -DCMAKE_INSTALL_PREFIX=
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /usr/bin/python (found version "2.7.15")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
-- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.6.34")
-- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.4")
-- Configuring done
-- Generating done
ninja -C build
ninja: Entering directory `build'
[104/537] Building CXX object Libraries/libcar/CMakeFiles/car.dir/Sources/Rendition.cpp.o
FAILED: Libraries/libcar/CMakeFiles/car.dir/Sources/Rendition.cpp.o
/usr/bin/c++ -Dcar_EXPORTS -I../Libraries/libcar/Headers -I../Libraries/ext/Headers -I../Libraries/libbom/Headers -I../Libraries/libutil/Headers -std=c++11 -fno-rtti -fno-exceptions -fPIC -Wall -Werror -Wno-multichar -Wno-sign-compare -fdiagnostics-color -MD -MT Libraries/libcar/CMakeFiles/car.dir/Sources/Rendition.cpp.o -MF Libraries/libcar/CMakeFiles/car.dir/Sources/Rendition.cpp.o.d -o Libraries/libcar/CMakeFiles/car.dir/Sources/Rendition.cpp.o -c ../Libraries/libcar/Sources/Rendition.cpp
../Libraries/libcar/Sources/Rendition.cpp: In member function ‘std::vector<unsigned char> car::Rendition::write() const’:
../Libraries/libcar/Sources/Rendition.cpp:532:12: error: ‘char* strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying 4 bytes from a string of the same length [-Werror=stringop-truncation]
strncpy(header.magic, "ISTC", 4);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
../Libraries/libcar/Sources/Rendition.cpp:679:16: error: ‘char* strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying 4 bytes from a string of the same length [-Werror=stringop-truncation]
strncpy(raw_header.magic, "DWAR", 4);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
[106/537] Building CXX object Libraries/libcar/CMakeFiles/car.dir/Sources/Writer.cpp.o
FAILED: Libraries/libcar/CMakeFiles/car.dir/Sources/Writer.cpp.o
/usr/bin/c++ -Dcar_EXPORTS -I../Libraries/libcar/Headers -I../Libraries/ext/Headers -I../Libraries/libbom/Headers -I../Libraries/libutil/Headers -std=c++11 -fno-rtti -fno-exceptions -fPIC -Wall -Werror -Wno-multichar -Wno-sign-compare -fdiagnostics-color -MD -MT Libraries/libcar/CMakeFiles/car.dir/Sources/Writer.cpp.o -MF Libraries/libcar/CMakeFiles/car.dir/Sources/Writer.cpp.o.d -o Libraries/libcar/CMakeFiles/car.dir/Sources/Writer.cpp.o -c ../Libraries/libcar/Sources/Writer.cpp
../Libraries/libcar/Sources/Writer.cpp: In member function ‘void car::Writer::write() const’:
../Libraries/libcar/Sources/Writer.cpp:101:12: error: ‘char* strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying 4 bytes from a string of the same length [-Werror=stringop-truncation]
strncpy(header->magic, "RATC", 4);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
../Libraries/libcar/Sources/Writer.cpp:131:14: error: ‘char* strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying 4 bytes from a string of the same length [-Werror=stringop-truncation]
strncpy(keyfmt->magic, "tmfk", 4);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
[109/537] Building CXX object Libraries/libcar/CMakeFiles/test_car_Rendition.dir/Tests/test_Rendition.cpp.o
ninja: build stopped: subcommand failed.
make: *** [Makefile:22: all] Error 1
ynx0
Metadata
Metadata
Assignees
Labels
No labels