Repository navigation
Build and configure with a C++ compiler - #1317
Conversation
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1317
Scan targets checked: wolfssh-src, wolfssh-bugs
Coverage: 0 of 7 in-scope changed file(s) opened by the reviewer; not opened: examples/echoserver/echoserver.c, src/certman.c, src/internal.c, src/keygen.c, tests/auth.c, tests/regress.c, wolfssh/test.h
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
56e4a18 to
b10293b
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1317
Scan targets checked: none
Unchanged since last review (not re-run): wolfssh-src, wolfssh-bugs
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
b10293b to
bcdabcf
Compare
philljj
left a comment
There was a problem hiding this comment.
tests good.
nit: add a c++ github workflow so this doesn't break in the future
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1317
Scan targets checked: wolfssh-src, wolfssh-bugs
Not reviewed (no scan target covers them): .github/workflows/cxx-check.yml, configure.ac
Coverage: 1 of 2 in-scope changed file(s) opened by the reviewer; not opened: src/ssh.c
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
4b50732 to
f0945b4
Compare
AC_CHECK_LIB and AC_CHECK_FUNCS declare the probed symbol themselves, without extern "C", so under CC=g++ the link looks for a mangled name and the check fails. Probe each library with AC_LINK_IFELSE through the header the sources use, so the checks work under C and C++. - wolfssl: wolfCrypt_Init and wc_ecc_set_rng, after options.h - util: forkpty through pty.h or util.h; glibc before 2.34 needs -lutil - crypt: crypt through unistd.h, with the XSI feature-test macros - wolftpm: wolfTPM2_Init through wolftpm/tpm2_wrap.h
C++ rejects three C idioms the tree uses: a conditional mixing an enum
constant with a byte, one mixing INADDR_ANY with a pointer, and a {0}
initializer for a struct. Cast the integer arms of the conditionals,
and clear the structs with WMEMSET instead.
- internal.c, regress.c: cast the ID_UNKNOWN arm to byte
- test.h: cast INADDR_ANY through size_t to const char*
- keygen.c, certman.c, echoserver.c, auth.c: replace {0} with WMEMSET
Run the wolfSSL link probe under AC_CACHE_CHECK with AC_CHECK_LIB's cache name, so a preset ac_cv_lib_wolfssl_wolfCrypt_Init=yes skips the link test. The mingw cert-store CI job relies on this, as it has no cross-built wolfSSL to link against.
The four format strings are used only through WLOG(), so they now sit under the same DEBUG_WOLFSSH/WOLFSSH_SSHD condition that compiles it in. A namespace-scope const is internal in C++, and clang++ rejected the unused arrays with -Wunused-const-variable under -Werror.
Build wolfSSH with a C++ compiler as CC and run make check, so a change that does not compile as C++ fails CI. wolfSSL is built as C. - g++ and clang++ on Ubuntu, Apple clang++ on macOS - default and --enable-all configurations, all with -Werror - clang++ also gets -Wno-deprecated for its .c-as-C++ warning
f0945b4 to
c3a7e0a
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1317
Scan targets checked: wolfssh-src, wolfssh-bugs
Not reviewed (no scan target covers them): .github/workflows/cxx-check.yml, configure.ac
Coverage: 1 of 1 in-scope changed file(s) opened by the reviewer
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
configure and the sources now work with a C++ compiler as
CC. Autoconf'sAC_CHECK_LIBandAC_CHECK_FUNCSdeclare the probed symbol withoutextern "C", so underCC=g++every library check failed to link.AC_LINK_IFELSEthrough the headers the sources useWMEMSETinstead of{0}