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

libsam3 build failing on some distributions #60

Open
G10h4ck opened this issue Dec 12, 2022 · 2 comments
Open

libsam3 build failing on some distributions #60

G10h4ck opened this issue Dec 12, 2022 · 2 comments

Comments

@G10h4ck
Copy link
Contributor

G10h4ck commented Dec 12, 2022

In OBS on some distributions I get this errors

[   95s] src/libsam3/libsam3.c: In function 'int sam3tcpPrintf(int, const char*, ...)':
[   95s] src/libsam3/libsam3.c:254:22: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
[   95s]   254 |       if ((p = malloc(size + 4)) == NULL)
[   95s]       |                ~~~~~~^~~~~~~~~~
[   95s]       |                      |
[   95s]       |                      void*
[   95s] src/libsam3/libsam3.c:257:24: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
[   95s]   257 |       if ((np = realloc(p, size + 4)) == NULL) {
[   95s]       |                 ~~~~~~~^~~~~~~~~~~~~
[   95s]       |                        |
[   95s]       |                        void*
[   95s] CMake Deprecation Warning at CMakeLists.txt:2 (cmake_minimum_required):
[   95s]   Compatibility with CMake < 2.8.12 will be removed from a future version of
[   95s]   CMake.
[   95s] 
[   95s]   Update the VERSION argument <min> value or use a ...<max> suffix to tell
[   95s]   CMake that the project does not need compatibility with older versions.
[   95s] 
[   95s] 
[   95s] src/libsam3/libsam3.c: In function 'char* xstrdup(const char*, int)':
[   95s] src/libsam3/libsam3.c:413:23: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
[   95s]   413 |     char *res = malloc(len + 1);
[   95s]       |                 ~~~~~~^~~~~~~~~
[   95s]       |                       |
[   95s]       |                       void*
[   95s] src/libsam3/libsam3.c: In function 'SAMFieldList* sam3ParseReply(const char*)':
[   95s] src/libsam3/libsam3.c:467:33: error: invalid conversion from 'void*' to 'SAMFieldList*' [-fpermissive]
[   95s]   467 |   if ((first = last = c = malloc(sizeof(SAMFieldList))) == NULL)
[   95s]       |                           ~~~~~~^~~~~~~~~~~~~~~~~~~~~~
[   95s]       |                                 |
[   95s]       |                                 void*
[   95s] src/libsam3/libsam3.c:488:20: error: invalid conversion from 'void*' to 'SAMFieldList*' [-fpermissive]
[   95s]   488 |     if ((c = malloc(sizeof(SAMFieldList))) == NULL)
[   95s]       |              ~~~~~~^~~~~~~~~~~~~~~~~~~~~~
[   95s]       |                    |
[   95s]       |                    void*
[   95s] src/libsam3/libsam3.c:495:21: error: invalid conversion from 'const void*' to 'const char*' [-fpermissive]
[   95s]   495 |     if ((e1 = memchr(p, '=', e - p)) != NULL) {
[   95s]       |               ~~~~~~^~~~~~~~~~~~~~~
[   95s]       |                     |
[   95s]       |                     const void*
[   95s] src/libsam3/libsam3.c: In function 'Sam3Connection* sam3StreamConnect(Sam3Session*, const char*)':
[   95s] src/libsam3/libsam3.c:944:23: error: invalid conversion from 'void*' to 'Sam3Connection*' [-fpermissive]
[   95s]   944 |     if ((conn = calloc(1, sizeof(Sam3Connection))) == NULL) {
[   95s]       |                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
[   95s]       |                       |
[   95s]       |                       void*
[   95s] src/libsam3/libsam3.c: In function 'Sam3Connection* sam3StreamAccept(Sam3Session*)':
[   95s] src/libsam3/libsam3.c:1005:23: error: invalid conversion from 'void*' to 'Sam3Connection*' [-fpermissive]
[   95s]  1005 |     if ((conn = calloc(1, sizeof(Sam3Connection))) == NULL) {
[   95s]       |                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
[   95s]       |                       |
[   95s]       |                       void*
[   95s] src/libsam3/libsam3.c: In function 'int sam3DatagramSend(Sam3Session*, const char*, const void*, size_t)':
[   95s] src/libsam3/libsam3.c:1139:23: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
[   95s]  1139 |     if ((dbuf = malloc(dbufsz)) == NULL) {
[   95s]       |                 ~~~~~~^~~~~~~~
[   95s]       |                       |
[   95s]       |                       void*
[   95s] src/libsam3/libsam3.c: In function 'ssize_t sam3DatagramReceive(Sam3Session*, void*, size_t)':
[   95s] src/libsam3/libsam3.c:1192:43: warning: comparison of integer expressions of different signedness: 'ssize_t' {aka 'long int'} and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
[   95s]  1192 |       if ((size = size * 10 + v[0] - '0') > bufsize) {
[   95s]       |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
[   95s] -- The C compiler identification is GNU 12.2.1
[   95s] src/libsam3/libsam3.c: In function 'ssize_t sam3Base32Encode(char*, size_t, const void*, size_t)':
[   95s] src/libsam3/libsam3.c:1268:24: warning: comparison of integer expressions of different signedness: 'ssize_t' {aka 'long int'} and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
[   95s]  1268 |       if (destsize + 8 <= destsz) {
[   95s]       |           ~~~~~~~~~~~~~^~~~~~~~~
[   95s] src/libsam3/libsam3.c:1274:18: warning: comparison of integer expressions of different signedness: 'ssize_t' {aka 'long int'} and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
[   95s]  1274 |     if (destsize <= destsz) {
[   95s]       |         ~~~~~~~~~^~~~~~~~~
[   95s] src/libsam3/libsam3.c: In function 'ssize_t sam3Base32Decode(char*, size_t, const void*, size_t)':
[   95s] src/libsam3/libsam3.c:1333:24: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
[   95s]  1333 |       if (destsize + 8 <= destsz) {
[   95s]       |           ~~~~~~~~~~~~~^~~~~~~~~
[   95s] src/libsam3/libsam3.c:1339:18: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
[   95s]  1339 |     if (destsize <= destsz) {
[   95s]       |         ~~~~~~~~~^~~~~~~~~
[   95s] make[2]: *** [Makefile:36: src/libsam3/libsam3.o] Error 1
[   95s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/RetroShare/supportlibs/libsam3'
[   95s] make[1]: *** [Makefile.libretroshare:3518: ../../supportlibs/libsam3/libsam3.a] Error 2
[   95s] make[1]: *** Waiting for unfinished jobs....

you can see the full log here

https://build.opensuse.org/build/network:retroshare/Fedora_Rawhide/x86_64/retroshare-service-unstable/_log

@sehraf AFAIR you are the one who knows about libsam3, any idea on how to fix this?

Cheers

@sehraf
Copy link
Contributor

sehraf commented Dec 12, 2022

invalid conversion from 'void*' to 'char*

The usual C mess, I'd say. Feel free to report it to upstream. AFAIR you now have to explicitly cast the pointer given by malloc 🤷‍♂️ (or turn off the warning if possible 🤷‍♂️ ^2)

Since i cannot reproduce the issue, you might want to test if latest upstream might have fixed the issue already. RS is on https://github.com/i2p/libsam3/tree/8623304b62294dafbe477573f321a464fef721dd but are some new commits since then (though I didn't see anything that looks related).

@barracuda156
Copy link
Contributor

Also fails for me, though differently: i2p/libsam3#20

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

3 participants