tg
tg copied to clipboard
Compile error: ‘write’ reading 18 bytes from a region of size 17
While compiling with gcc -v =11.2.0
got next error:
main.c:824:7: error: ‘write’ reading 18 bytes from a region of size 17 [-Werror=stringop-overread] 824 | if (write (1, "SIGNAL received\n", 18) < 0) {
String "SIGNAL received\n" has size 17.
I did this today on Ubuntu 22.04 and got the same on GNU Make 4.3
Same bro. It also doen't work on Ubuntu 22.04 on my machine.
Fedora 37, same
I'm also suffering from this issue on Debian 12 (stable)
same
try this:
with modified tg/Makefile and deleted -Werror
nano Makefile
./configure
make
Or change main.c:824 18 -> 17
make
Anyone managed to solve this?
unfortunately, didn't help even after advices from @Paulchen232
uname -a
Linux ubuntu 5.15.0-87-generic #97-Ubuntu SMP Tue Oct 3 09:52:42 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
and after changing this https://github.com/vysheng/tg/issues/1763#issuecomment-1730716616 I get
tgl/queries.c: In function \u2018_tgl_do_send_photo\u2019:
tgl/queries.c:2091:10: error: cast between incompatible function types from \u2018void (*)(struct tgl_state *, void *, int, struct tgl_message *)\u2019 to \u2018void (*)(struct tgl_state *, void *, int)\u2019 [-Werror=cast-function-type]
2091 | ((void (*)(struct tgl_state *, void *, int))callback) (TLS, callback_extra, 0);
| ^
tgl/queries.c:2108:10: error: cast between incompatible function types from \u2018void (*)(struct tgl_state *, void *, int, struct tgl_message *)\u2019 to \u2018void (*)(struct tgl_state *, void *, int)\u2019 [-Werror=cast-function-type]
2108 | ((void (*)(struct tgl_state *, void *, int))callback) (TLS, callback_extra, 0);
| ^
tgl/queries.c:2141:10: error: cast between incompatible function types from \u2018void (*)(struct tgl_state *, void *, int, struct tgl_message *)\u2019 to \u2018void (*)(struct tgl_state *, void *, int)\u2019 [-Werror=cast-function-type]
2141 | ((void (*)(struct tgl_state *, void *, int))callback) (TLS, callback_extra, 0);
| ^
cc1: all warnings being treated as errors
make: *** [Makefile.tgl:20: objs/queries.o] Error 1
BTW, the strange behavior is that I don't have libpython-dev
but I had to install libpython2-dev
sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev libpython-dev make
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libpython-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
libpython2-dev
E: Package 'libpython-dev' has no installation candidate