vysheng / tg

telegram-cli
GNU General Public License v2.0
6.45k stars 1.53k forks source link

raspbian make #1785

Open Kreijstal opened 1 year ago

Kreijstal commented 1 year ago
cat tgl/scheme.tl tgl/encrypted_scheme.tl tgl/binlog.tl tgl/append.tl tgl/mtproto.tl > auto/scheme.tl
gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.1  -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl/tl-parser -c -MP -MD -MF dep/tl-parser.d -MQ objs/tl-parser.o -o objs/tl-parser.o tgl/tl-parser/tl-parser.c
tgl/tl-parser/tl-parser.c: In function ‘tl_parse_args134’:
tgl/tl-parser/tl-parser.c:1907:26: error: ‘sprintf’ may write a terminating nul past the end of the destination [-Werror=format-overflow=]
 1907 |         sprintf (s, "%lld", lrand48 () * (1ll << 32) + lrand48 ());
      |                          ^
tgl/tl-parser/tl-parser.c:1907:9: note: ‘sprintf’ output between 2 and 21 bytes into a destination of size 20
 1907 |         sprintf (s, "%lld", lrand48 () * (1ll << 32) + lrand48 ());
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile.tl-parser:4: objs/tl-parser.o] Error 1
wnienhaus commented 2 months ago

See #1711. Solution by @alex8224 worked for me.