Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error after make command #1664

Open
AgentZoy opened this issue Jun 13, 2020 · 16 comments
Open

error after make command #1664

AgentZoy opened this issue Jun 13, 2020 · 16 comments

Comments

@AgentZoy
Copy link

I trying to install this on raspbian (rasspberry pi)
After make command I got
gcc -I. -I. -I./tgl -g -O2 -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2 -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=] 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 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

How to fix it?
libssl1.0-dev libssl1.0.2 installed

@Paulchen232
Copy link

Perhaps delete -Werror in Makefile if you only have a warning.

@AgentZoy
Copy link
Author

Not helped
I'm found also this https://pimylifeup.com/raspberry-pi-telegram-cli/ Also not solves problem

@AgentZoy
Copy link
Author

Hi everyone, to anyone who aslo hits this issue: there is a file in the ‘tg’ folder called makefile, in there, delete the text “-Werror”, that will allow warnings during compilation instead of treating a warning as an error: you will need to install two additional packages:
sudo apt-get install libgcrypt20-dev
sudo apt-get install libssl-dev

not helped

@AgentZoy
Copy link
Author

I understand my mistake Fixed

@simenca
Copy link

simenca commented Jun 13, 2020

I am hitting the same issue how did you solved it?

@AgentZoy
Copy link
Author

Open this https://pimylifeup.com/raspberry-pi-telegram-cli/
Perferm step 4 To get the Telegram CLI to compile on our Raspberry Pi, we will first have to modify.....
Install this running command
sudo apt-get install libgcrypt20-dev
sudo apt-get install libssl-dev

After this delete delete -Werror in Makefile
save and close
run ./configure
run make

@AgentZoy AgentZoy reopened this Jun 13, 2020
@AgentZoy
Copy link
Author

But now I got
error: dereferencing pointer to incomplete type ‘RSA’ {aka ‘struct rsa_st’}
Previous error is now in warning state

@AgentZoy
Copy link
Author

you can fix it by add --disable-openssl flag:
./configure --disable-openssl
then you can make easily.

@simenca
Copy link

simenca commented Jun 13, 2020

still the same issue on my side

@AgentZoy
Copy link
Author

please ensure that flas is removed if you rerun ./configure it's added back

@simenca
Copy link

simenca commented Jun 13, 2020

what do you mean by flas (sorry I am a beginner...)

@AgentZoy
Copy link
Author

sorry flag

@simenca
Copy link

simenca commented Jun 13, 2020

got it thank you ... now the installation runs to the end. Thank you but the program stops immediately when i launch bin/telegram-cli -k tg-server.pub

@flocko-motion
Copy link

doesn't build properly - there seem to be three problems with the code:

gcc -I. -I. -I./tgl -g -O2 -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2 -DHAVE_CONFIG_H -Wall -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/crypto/rsa_pem_openssl.d -MQ objs/crypto/rsa_pem_openssl.o -o objs/crypto/rsa_pem_openssl.o tgl/crypto/rsa_pem_openssl.c
tgl/crypto/rsa_pem_openssl.c: In function ‘TGLC_rsa_new’:
tgl/crypto/rsa_pem_openssl.c:41:6: error: dereferencing pointer to incomplete type ‘RSA {aka struct rsa_st}’
ret->e = unwrap_bn (TGLC_bn_new ());
^
tgl/crypto/rsa_pem_openssl.c: In function ‘TGLC_rsa_n’:
tgl/crypto/rsa_pem_openssl.c:52:1: warning: control reaches end of non-void function [-Wreturn-type]
RSA_GETTER(n);
^
tgl/crypto/rsa_pem_openssl.c: In function ‘TGLC_rsa_e’:
tgl/crypto/rsa_pem_openssl.c:53:1: warning: control reaches end of non-void function [-Wreturn-type]
RSA_GETTER(e);
^
Makefile.tgl:20: recipe for target 'objs/crypto/rsa_pem_openssl.o' failed
make: *** [objs/crypto/rsa_pem_openssl.o] Error 1

@jm-my
Copy link

jm-my commented Dec 5, 2020

bloody rooky, too... but chould it be the same problem with or without `-Werror´ ?

first try with clean
./configure
make

gcc -I. -I. -I./tgl -g -O2 -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2 -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=]
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
sprintf (s, "%lld", lrand48 () * (1ll << 32) + lrand48 ());
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile.tl-parser:4: objs/tl-parser.o] Fehler 1

second try with modified tg/Makefile and deleted `-Werror ´
nano Makefile
./configure
make

gcc -I. -I. -I./tgl -g -O2 -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2 -DHAVE_CONFIG_H -Wall -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: warning: ‘sprintf’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
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
sprintf (s, "%lld", lrand48 () * (1ll << 32) + lrand48 ());
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

there are some 'new' warnings too:
tgl/queries.c:2091:10: warning: cast between incompatible function types from ‘void (*)(struct tgl_state *, void *, int, struct tgl_message )’ to ‘void ()(struct tgl_state *, void , int)’ [-Wcast-function-type]
((void (
)(struct tgl_state *, void , int))callback) (TLS, callback_extra, 0);
^
tgl/queries.c:2108:10: warning: cast between incompatible function types from ‘void (
)(struct tgl_state *, void *, int, struct tgl_message )’ to ‘void ()(struct tgl_state *, void , int)’ [-Wcast-function-type]
((void (
)(struct tgl_state *, void , int))callback) (TLS, callback_extra, 0);
^
tgl/queries.c:2141:10: warning: cast between incompatible function types from ‘void (
)(struct tgl_state *, void *, int, struct tgl_message )’ to ‘void ()(struct tgl_state *, void , int)’ [-Wcast-function-type]
((void (
)(struct tgl_state *, void *, int))callback) (TLS, callback_extra, 0);
^
...
gcc -I. -I. -I./tgl -g -O2 -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2 -DHAVE_CONFIG_H -Wall -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/crypto/rsa_pem_openssl.d -MQ objs/crypto/rsa_pem_openssl.o -o objs/crypto/rsa_pem_openssl.o tgl/crypto/rsa_pem_openssl.c
tgl/crypto/rsa_pem_openssl.c: In function ‘TGLC_rsa_new’:
tgl/crypto/rsa_pem_openssl.c:41:6: error: dereferencing pointer to incomplete type ‘RSA’ {aka ‘struct rsa_st’}
ret->e = unwrap_bn (TGLC_bn_new ());
^~
tgl/crypto/rsa_pem_openssl.c: In function ‘TGLC_rsa_n’:
tgl/crypto/rsa_pem_openssl.c:52:1: warning: control reaches end of non-void function [-Wreturn-type]
RSA_GETTER(n);
^~~~~~~~~~
tgl/crypto/rsa_pem_openssl.c: In function ‘TGLC_rsa_e’:
tgl/crypto/rsa_pem_openssl.c:53:1: warning: control reaches end of non-void function [-Wreturn-type]
RSA_GETTER(e);
^~~~~~~~~~
make: *** [Makefile.tgl:20: objs/crypto/rsa_pem_openssl.o] Fehler 1

@mcveight
Copy link

I got this error after run make command
main.c: In function ‘termination_signal_handler’: 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) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from main.c:29: /usr/include/unistd.h:367:16: note: in a call to function ‘write’ declared with attribute ‘access (read_only, 2, 3)’ 367 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur | ^~~~~ cc1: all warnings being treated as errors make: *** [Makefile:48: objs/main.o] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants