T175: Building v9.0.0 with gcc 7.4.0 fails.
Description
Originally reported by TheMarlboroMan: https://bugs.libssh.org/T175
Compìlation fails when doing an out of source build with gcc 7.4.0:
In file included from /path/to/build/src/libcrypto.c:31:0:
/path/to/build/include/libssh/priv.h:400:22: error: expected ‘)’ before ‘__attribute__’
# define __unused__ __attribute__((unused))
^
In file included from /path/to/build/src/libcrypto.c:59:0:
/usr/include/valgrind/valgrind.h:6753:56: error: expected ‘,’ or ‘;’ before ‘)’ token
__attribute__((format(__printf__, 1, 2), __unused__));
^
In file included from /path/to/build/src/libcrypto.c:31:0:
/path/to/build/include/libssh/priv.h:400:22: error: expected ‘)’ before ‘__attribute__’
# define __unused__ __attribute__((unused))
^
In file included from /path/to/build/src/libcrypto.c:59:0:
/usr/include/valgrind/valgrind.h:6791:56: error: expected ‘,’ or ‘;’ before ‘)’ token
__attribute__((format(__printf__, 1, 2), __unused__));
Seems like the unused attribute is not playing nice with the compiler. A quick fix is to just comment it out:
sed -i 's/define __unused__ __attribute__((unused))/define __unused__ \/*__attribute__((unused))*\//g' libssh/priv.h
But that's not surely what the author had in mind.
Comments:
Jakuje commented on 2019-09-20 13:05:31 UTC:
Can you clarify on what platform you are experiencing these issues?
We are running the CI with GCC 7.4.1 on Tumbleweed and it looks like it works fine (the master as well as the v0.9 release). Here is the respective build for the 0.9 release:
https://gitlab.com/libssh/libssh-mirror/-/jobs/241740932
TheMarlboroMan commented on 2019-09-20 19:08:33 UTC:
Yes, of course. I am not at it right now, but it is am almost sure it is an Ubuntu 16, 64bit, with GCC 7.4.0. The system itself is standard issue but GCC i had to add some PPAs (I think) and apt-get install. Let me know if you need anything else.
Jakuje commented on 2020-04-16 08:12:31 UTC:
This has changed recently in master with commit 742d81ec. Can you check if you can still reproduce the issue with the referenced commit/master/
sahanaprasad07 commented on 2020-11-19 16:21:53 UTC:
@TheMarlboroMan hi, could you confirm if you can still reproduce this one, if not we could close this one. Thank you.