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

compile error on boringssl - [-Werror,-Wunused-but-set-variable] #213

Open
ChinW opened this issue Dec 15, 2023 · 3 comments
Open

compile error on boringssl - [-Werror,-Wunused-but-set-variable] #213

ChinW opened this issue Dec 15, 2023 · 3 comments

Comments

@ChinW
Copy link

ChinW commented Dec 15, 2023

i am trying to compile the library from apple/M1 chip, but keep getting below error about boringSSL, i wonder if there is any pointer here, tried to search around but didnt get a quick shot yet.

# See https://everything.curl.dev/source/build/tls/boringssl
mkdir -p lib
ln -sf ../crypto/libcrypto.a lib/libcrypto.a
ln -sf ../ssl/libssl.a lib/libssl.a
cp -Rf ../include .
-- The C compiler identification is AppleClang 15.0.0.15000040
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- The CXX compiler identification is AppleClang 15.0.0.15000040
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Perl: /usr/bin/perl (found version "5.30.3")
-- The ASM compiler identification is AppleClang
-- Found assembler: /Library/Developer/CommandLineTools/usr/bin/gcc
-- Configuring done (1.8s)
-- Generating done (0.5s)
-- Build files have been written to: /curl-impersonate/build/boringssl/build
[189/424] Building C object crypto/CMakeFiles/crypto.dir/x509/t_x509.c.o
FAILED: crypto/CMakeFiles/crypto.dir/x509/t_x509.c.o
/usr/bin/gcc -DBORINGSSL_IMPLEMENTATION -Icurl-impersonate/build/boringssl/third_party/googletest/include -I/curl-impersonate/build/boringssl/crypto/../include -Wno-unknown-warning-option -Wno-stringop-overflow -Wno-array-bounds -Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -Wvla -Wshadow -ggdb -Wall -fvisibility=hidden -fno-common -Wnewline-eof -fcolor-diagnostics -Wimplicit-fallthrough -Wmissing-prototypes -Wold-style-definition -Wstrict-prototypes -D_XOPEN_SOURCE=700 -O3 -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk -fPIC -MD -MT crypto/CMakeFiles/crypto.dir/x509/t_x509.c.o -MF crypto/CMakeFiles/crypto.dir/x509/t_x509.c.o.d -o crypto/CMakeFiles/crypto.dir/x509/t_x509.c.o -c /curl-impersonate/build/boringssl/crypto/x509/t_x509.c
/curl-impersonate/build/boringssl/crypto/x509/t_x509.c:321:18: error: variable 'l' set but not used [-Werror,-Wunused-but-set-variable]
    int ret = 0, l, i;
@ChinW
Copy link
Author

ChinW commented Dec 15, 2023

seems also related to #201

will give a try

@infostud
Copy link

infostud commented Jan 29, 2024

Also occurs with FreeBSD and clang. Work around is to correct the source code and remove the unused variable 'l' It is declared, on the left of an assignment operation, and l-- decremented in two locations. Its value isn't used anywhere.
There are more errors unfortunately.

@lwthiker
Copy link
Owner

@ChinW @infostud It would be great if you could test #217 to see if the compilation errors are solved on your machines.

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