Skip to content

Instantly share code, notes, and snippets.

@darrenfu
Created December 6, 2022 05:39
Show Gist options
  • Save darrenfu/e8064cb4847edd4ae050a60561dee514 to your computer and use it in GitHub Desktop.
Save darrenfu/e8064cb4847edd4ae050a60561dee514 to your computer and use it in GitHub Desktop.
snprintf error
[1345/1495] Building CXX object velox/external/duckdb/tpch/dbgen/CMakeFiles/dbgen.dir/build.cpp.o[K.oParserTest.cpp.oogregateTest.cpp.o
FAILED: velox/external/duckdb/tpch/dbgen/CMakeFiles/dbgen.dir/build.cpp.o
ccache /usr/bin/c++ -DDBNAME=dss -DMAC -DORACLE -DTPCH -I_deps/protobuf-src/src -I../../. -I../../velox/external/xxhash -I../../velox/external/duckdb/tpch/include -I../../velox/external/duckdb/tpch/.. -isystem ../../velox -isystem ../../velox/external -isystem ../../velox/external/duckdb -isystem ../../velox/external/duckdb/tpch/dbgen/include -mavx2 -mfma -mavx -mf16c -mlzcnt -std=c++17 -mbmi2 -D USE_VELOX_COMMON_BASE -D HAS_UNCAUGHT_EXCEPTIONS -Werror -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-sign-compare -Wno-ignored-qualifiers -Wno-implicit-fallthrough -Wno-empty-body -Wno-class-memaccess -Wno-comment -Wno-int-in-bool-context -Wno-redundant-move -Wno-array-bounds -Wno-maybe-uninitialized -Wno-unused-result -Wno-format-overflow -Wno-strict-aliasing -Wno-type-limits -O3 -DNDEBUG -fPIC -std=gnu++17 -Wno-write-strings -MD -MT velox/external/duckdb/tpch/dbgen/CMakeFiles/dbgen.dir/build.cpp.o -MF velox/external/duckdb/tpch/dbgen/CMakeFiles/dbgen.dir/build.cpp.o.d -o velox/external/duckdb/tpch/dbgen/CMakeFiles/dbgen.dir/build.cpp.o -c ../../velox/external/duckdb/tpch/dbgen/build.cpp
../../velox/external/duckdb/tpch/dbgen/build.cpp: In function ‘void gen_phone(long long int, char*, seed_t*)’:
../../velox/external/duckdb/tpch/dbgen/build.cpp:56:27: error: ‘__builtin___snprintf_chk’ output may be truncated before the last format character [-Werror=format-truncation=]
56 | snprintf(target, 3, "%02d", (int)(10 + (ind % NATIONS_MAX)));
| ^
In file included from /usr/include/stdio.h:867,
from ../../velox/external/duckdb/tpch/dbgen/build.cpp:11:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: ‘__builtin___snprintf_chk’ output between 3 and 4 bytes into a destination of size 3
67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment