From 20577e516ce7757e3266c9f0301245280e019c4d Mon Sep 17 00:00:00 2001 From: Fufu Fang Date: Sat, 24 Aug 2019 18:13:47 +0100 Subject: [PATCH] updated README.me, suppress "-Wunused-function" in crypto lock function in network.c --- README.md | 10 ++-------- src/network.c | 3 +++ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 859d1f9..f31973c 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ one option per line. For example: --username test --password test -f - + ## Compilation This program was developed under Debian Stretch. If you are using the same operating system as me, you need ``libgumbo-dev``, ``libfuse-dev``, @@ -94,12 +94,6 @@ operating system as me, you need ``libgumbo-dev``, ``libfuse-dev``, If you run Debian Stretch, and you have OpenSSL 1.0.2 installed, and you get warnings that look like below during compilation, - network.c:70:22: warning: ‘thread_id’ defined but not used [-Wunused-function] - static unsigned long thread_id(void) - ^~~~~~~~~ - network.c:57:13: warning: ‘lock_callback’ defined but not used [-Wunused-function] - static void lock_callback(int mode, int type, char *file, int line) - ^~~~~~~~~~~~~ /usr/bin/ld: warning: libcrypto.so.1.0.2, needed by /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libcurl.so, may conflict with libcrypto.so.1.1 then you need to check if ``libssl1.0-dev`` had been installed properly. If you @@ -126,7 +120,7 @@ OpenSSL, as the pthread mutex functions are designed for OpenSSL. The SSL engine version string looks something like this: libcurl SSL engine: OpenSSL/1.0.2l - + ## The Technical Details I noticed that most HTTP directory listings don't provide the file size for the web page itself. I suppose this makes perfect sense, as they are generated on diff --git a/src/network.c b/src/network.c index 36eb4fb..67dcc4b 100644 --- a/src/network.c +++ b/src/network.c @@ -30,6 +30,8 @@ static pthread_mutex_t curl_lock; /** \brief network configuration */ /* -------------------- Functions -------------------------- */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" static void crypto_lock_callback(int mode, int type, char *file, int line) { (void)file; @@ -48,6 +50,7 @@ static unsigned long thread_id(void) ret = (unsigned long)pthread_self(); return ret; } +#pragma GCC diagnostic pop static void crypto_lock_init(void) {