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

Building fails with 'invalid conversion from 'uint8_t* {aka unsigned char*}' to 'char*'' #45

Open
plusky opened this issue Dec 4, 2017 · 4 comments

Comments

@plusky
Copy link

plusky commented Dec 4, 2017

When building on currenct openSUSE, following occurs:

[   45s] g++ -DHAVE_CONFIG_H -I. -I..  -Wall -I../lib/includes -I../lib/includes  -DHAVE_CONFIG_H   -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -c -o echoserv.o echoserv.cc
[   46s] echoserv.cc: In function 'std::__cxx11::string base64(const string&)':
[   46s] echoserv.cc:126:83: error: invalid conversion from 'uint8_t* {aka unsigned char*}' to 'char*' [-fpermissive]
[   46s]    base64_encode_raw(dst, src.size(), reinterpret_cast<const uint8_t*>(src.c_str()));
[   46s]                                                                                    ^
[   46s] In file included from echoserv.cc:52:0:
[   46s] /usr/include/nettle/base64.h:117:1: note:   initializing argument 1 of 'void nettle_base64_encode_raw(char*, size_t, const uint8_t*)'
[   46s]  base64_encode_raw(char *dst, size_t length, const uint8_t *src);
[   46s]  ^

Building with -fpermissive as wourkaround helps

@vdloo
Copy link

vdloo commented Dec 26, 2017

ran into this too:

# make
make  all-recursive
make[1]: Entering directory '/usr/etc/wslay'
Making all in lib
make[2]: Entering directory '/usr/etc/wslay/lib'
Making all in includes
make[3]: Entering directory '/usr/etc/wslay/lib/includes'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/usr/etc/wslay/lib/includes'
make[3]: Entering directory '/usr/etc/wslay/lib'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/usr/etc/wslay/lib'
make[2]: Leaving directory '/usr/etc/wslay/lib'
Making all in tests
make[2]: Entering directory '/usr/etc/wslay/tests'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/usr/etc/wslay/tests'
Making all in examples
make[2]: Entering directory '/usr/etc/wslay/examples'
g++ -DHAVE_CONFIG_H -I. -I..  -Wall -I../lib/includes -I../lib/includes  -DHAVE_CONFIG_H   -g -O2 -MT echoserv.o -MD -MP -MF .deps/echoserv.Tpo -c -o echoserv.o echoserv.cc
echoserv.cc: In function 'std::__cxx11::string base64(const string&)':
echoserv.cc:126:83: error: invalid conversion from 'uint8_t* {aka unsigned char*}' to 'char*' [-fpermissive]
   base64_encode_raw(dst, src.size(), reinterpret_cast<const uint8_t*>(src.c_str()));
                                                                                   ^
In file included from echoserv.cc:52:0:
/usr/include/nettle/base64.h:117:1: note:   initializing argument 1 of 'void nettle_base64_encode_raw(char*, size_t, const uint8_t*)'
 base64_encode_raw(char *dst, size_t length, const uint8_t *src);
 ^
make[2]: *** [Makefile:506: echoserv.o] Error 1
make[2]: Leaving directory '/usr/etc/wslay/examples'
make[1]: *** [Makefile:442: all-recursive] Error 1
make[1]: Leaving directory '/usr/etc/wslay'
make: *** [Makefile:370: all] Error 2

edit: Archlinux updated nettle to 3.4-1 on 2017-11-21. this commit looks like it might be related https://git.lysator.liu.se/nettle/nettle/commit/f2da403135e2b2f641cf0f8219ad5b72083b7dfd

vdloo added a commit to vdloo/wslay that referenced this issue Dec 26, 2017
forking and temporarily removing the examples because it still compiles
without, also see tatsuhiro-t#45

broke my h2o build: https://github.com/h2o/h2o
vdloo added a commit to vdloo/raptiformica-map that referenced this issue Dec 26, 2017
gladk added a commit to gladk/wslay that referenced this issue Dec 29, 2017
chadouming pushed a commit to chadouming/wslay that referenced this issue Feb 18, 2018
@ryanmjacobs
Copy link

I ran into this issue as well. Please merge in one of these fixes.

@tatsuhiro-t
Copy link
Owner

#49 fixed this issue.

@YuyaAizawa
Copy link

I got the same error on the same line. #4a937cd
My OS is Raspbian.

# make
make  all-recursive
make[1]: Entering directory '/home/poi/git/wslay'
Making all in lib
make[2]: Entering directory '/home/poi/git/wslay/lib'
Making all in includes
make[3]: Entering directory '/home/poi/git/wslay/lib/includes'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/poi/git/wslay/lib/includes'
make[3]: Entering directory '/home/poi/git/wslay/lib'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/poi/git/wslay/lib'
make[2]: Leaving directory '/home/poi/git/wslay/lib'
Making all in tests
make[2]: Entering directory '/home/poi/git/wslay/tests'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/poi/git/wslay/tests'
Making all in examples
make[2]: Entering directory '/home/poi/git/wslay/examples'
g++ -DHAVE_CONFIG_H -I. -I..  -Wall -I../lib/includes -I../lib/includes  -DHAVE_CONFIG_H   -g -O2 -MT echoserv.o -MD -MP -MF .deps/echoserv.Tpo -c -o echoserv.o echoserv.cc
echoserv.cc: In function ‘std::__cxx11::string base64(const string&)’:
echoserv.cc:126:83: error: invalid conversion from ‘char*’ to ‘uint8_t* {aka unsigned char*}’ [-fpermissive]
   base64_encode_raw(dst, src.size(), reinterpret_cast<const uint8_t*>(src.c_str()));
                                                                                   ^
In file included from echoserv.cc:52:0:
/usr/include/nettle/base64.h:115:1: note:   initializing argument 1 of ‘void nettle_base64_encode_raw(uint8_t*, size_t, const uint8_t*)’
 base64_encode_raw(uint8_t *dst, size_t length, const uint8_t *src);
 ^
Makefile:507: recipe for target 'echoserv.o' failed
make[2]: *** [echoserv.o] Error 1
make[2]: Leaving directory '/home/poi/git/wslay/examples'
Makefile:443: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/poi/git/wslay'
Makefile:371: recipe for target 'all' failed
make: *** [all] Error 2

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

5 participants