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

build warning: unused-variable #136

Open
sergey-safarov opened this issue Jul 30, 2023 · 0 comments
Open

build warning: unused-variable #136

sergey-safarov opened this issue Jul 30, 2023 · 0 comments

Comments

@sergey-safarov
Copy link

configure: WARNING: unrecognized options: --with-pcre, --enable-unicode, --enable-ipv6, --enable-eep
+ make -j2
  CC       util/src/stir_shaken_ca-stir_shaken_ca.o
  CC       util/src/stir_shaken_ca-mongoose.o
util/src/stir_shaken_ca.c: In function 'ca_handle_api_cert':
util/src/stir_shaken_ca.c:488:8: warning: unused variable 'na' [-Wunused-variable]
  char *na = "2029-01-01T00:00:00Z";
        ^~
util/src/stir_shaken_ca.c:487:8: warning: unused variable 'nb' [-Wunused-variable]
  char *nb = "2019-01-01T00:00:00Z";
        ^~
util/src/stir_shaken_ca.c:486:8: warning: unused variable 'expires' [-Wunused-variable]
  char *expires = "2029-03-01T14:09:00Z";
        ^~~~~~~
util/src/stir_shaken_ca.c:484:8: warning: unused variable 'token' [-Wunused-variable]
  char *token = NULL;
        ^~~~~
util/src/stir_shaken_ca.c:483:6: warning: unused variable 'csr_len' [-Wunused-variable]
  int csr_len = 0;
      ^~~~~~~
util/src/stir_shaken_ca.c:482:14: warning: unused variable 'csr_b64' [-Wunused-variable]
  const char *csr_b64 = NULL;
              ^~~~~~~
util/src/stir_shaken_ca.c:480:8: warning: unused variable 'pCh' [-Wunused-variable]
  char *pCh = NULL;
        ^~~
util/src/stir_shaken_ca.c:479:14: warning: unused variable 'spc' [-Wunused-variable]
  const char *spc = NULL;
              ^~~
util/src/stir_shaken_ca.c: In function 'ca_handle_api_authz':
util/src/stir_shaken_ca.c:950:18: warning: unused variable 'cert_url' [-Wunused-variable]
      const char *cert_url = NULL;
                  ^~~~~~~~
util/src/stir_shaken_ca.c:949:30: warning: unused variable 'sp_code' [-Wunused-variable]
      unsigned long long  int sp_code = 0;
                              ^~~~~~~
util/src/stir_shaken_ca.c:947:18: warning: unused variable 'spc_str' [-Wunused-variable]
      const char *spc_str = NULL;
                  ^~~~~~~
util/src/stir_shaken_ca.c:945:12: warning: unused variable 'token' [-Wunused-variable]
      char *token = NULL;
            ^~~~~
util/src/stir_shaken_ca.c:833:6: warning: unused variable 'args_n' [-Wunused-variable]
  int args_n = 0;
      ^~~~~~
util/src/stir_shaken_ca.c:832:11: warning: unused variable 'authz_secret' [-Wunused-variable]
  uint32_t authz_secret = 0;
           ^~~~~~~~~~~~
util/src/stir_shaken_ca.c:825:8: warning: unused variable 'token' [-Wunused-variable]
  char *token = NULL;
        ^~~~~
util/src/stir_shaken_ca.c:823:8: warning: unused variable 'pCh' [-Wunused-variable]
  char *pCh = NULL;
        ^~~
util/src/stir_shaken_ca.c: In function 'ca_handle_api_authority_check':
util/src/stir_shaken_ca.c:1174:6: warning: unused variable 'authority_check' [-Wunused-variable]
  int authority_check = 0;
      ^~~~~~~~~~~~~~~
util/src/stir_shaken_ca.c: In function 'ca_event_handler':
util/src/stir_shaken_ca.c:1311:18: warning: unused variable 'port_i' [-Wunused-variable]
     unsigned int port_i = 0;
                  ^~~~~~
util/src/stir_shaken_ca.c: In function 'stir_shaken_run_ca_service':
util/src/stir_shaken_ca.c:1373:31: warning: variable 'opts' set but not used [-Wunused-but-set-variable]
  struct mg_http_endpoint_opts opts = { 0 };
                               ^~~~
At top level:
util/src/stir_shaken_ca.c:211:13: warning: 'ca_handle_bad_request' defined but not used [-Wunused-function]
 static void ca_handle_bad_request(struct mg_connection *nc, int event, void *hm, void *d)
             ^~~~~~~~~~~~~~~~~~~~~
util/src/stir_shaken_ca.c: In function 'ca_handle_api_authz':
util/src/stir_shaken_ca.c:1088:74: warning: '%s' directive output may be truncated writing up to 999 bytes into a region of size 997 [-Wformat-truncation=]
       snprintf(session->sp.cert_name, sizeof(session->sp.cert_name), "sp_%s_%llu_%zu.pem", spc, secret, time(NULL));
                                                                          ^~                ~~~
util/src/stir_shaken_ca.c:1088:70: note: using the range [0, 18446744073709551615] for directive argument
       snprintf(session->sp.cert_name, sizeof(session->sp.cert_name), "sp_%s_%llu_%zu.pem", spc, secret, time(NULL));
                                                                      ^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:873,
                 from include/stir_shaken.h:8,
                 from util/src/stir_shaken_ca.c:1:
/usr/include/bits/stdio2.h:68:10: note: '__builtin___snprintf_chk' output between 12 and 1049 bytes into a destination of size 1000
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __glibc_objsize (__s), __fmt,
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~
  CC       examples/stir_shaken_cert_req-stir_shaken_cert_req.o
  CC       examples/stir_shaken_as_easy-stir_shaken_as_easy.o
examples/stir_shaken_as_easy.c: In function 'main':
examples/stir_shaken_as_easy.c:19:6: warning: unused variable 'ret' [-Wunused-variable]
  int ret = 0;
      ^~~
  CC       examples/stir_shaken_vs_easy-stir_shaken_vs_easy.o
  CC       util/src/stirshaken-stir_shaken_tool_command.o
In file included from util/src/stir_shaken_tool_command.c:1:
util/include/stir_shaken_tool.h:231:3: warning: 'options' defined but not used [-Wunused-variable]
 } options;
   ^~~~~~~
util/include/stir_shaken_tool.h:197:3: warning: 'sp' defined but not used [-Wunused-variable]
 } sp;
   ^~
util/include/stir_shaken_tool.h:185:3: warning: 'pa' defined but not used [-Wunused-variable]
 } pa;
   ^~
util/include/stir_shaken_tool.h:174:3: warning: 'ca' defined but not used [-Wunused-variable]
 } ca;
   ^~
  CC       util/src/stirshaken-stir_shaken_tool.o
util/src/stir_shaken_tool.c: In function 'main':
util/src/stir_shaken_tool.c:76:14: warning: unused variable 'command_name' [-Wunused-variable]
  const char *command_name = COMMAND_NAME_UNKNOWN;
              ^~~~~~~~~~~~
util/src/stir_shaken_tool.c:71:23: warning: unused variable 'status' [-Wunused-variable]
  stir_shaken_status_t status = STIR_SHAKEN_STATUS_OK;
                       ^~~~~~
  CC       util/src/stirshaken-stir_shaken_ca.o
util/src/stir_shaken_ca.c: In function 'ca_handle_api_cert':
util/src/stir_shaken_ca.c:488:8: warning: unused variable 'na' [-Wunused-variable]
  char *na = "2029-01-01T00:00:00Z";
        ^~
util/src/stir_shaken_ca.c:487:8: warning: unused variable 'nb' [-Wunused-variable]
  char *nb = "2019-01-01T00:00:00Z";
        ^~
util/src/stir_shaken_ca.c:486:8: warning: unused variable 'expires' [-Wunused-variable]
  char *expires = "2029-03-01T14:09:00Z";
        ^~~~~~~
util/src/stir_shaken_ca.c:484:8: warning: unused variable 'token' [-Wunused-variable]
  char *token = NULL;
        ^~~~~
util/src/stir_shaken_ca.c:483:6: warning: unused variable 'csr_len' [-Wunused-variable]
  int csr_len = 0;
      ^~~~~~~
util/src/stir_shaken_ca.c:482:14: warning: unused variable 'csr_b64' [-Wunused-variable]
  const char *csr_b64 = NULL;
              ^~~~~~~
util/src/stir_shaken_ca.c:480:8: warning: unused variable 'pCh' [-Wunused-variable]
  char *pCh = NULL;
        ^~~
util/src/stir_shaken_ca.c:479:14: warning: unused variable 'spc' [-Wunused-variable]
  const char *spc = NULL;
              ^~~
util/src/stir_shaken_ca.c: In function 'ca_handle_api_authz':
util/src/stir_shaken_ca.c:950:18: warning: unused variable 'cert_url' [-Wunused-variable]
      const char *cert_url = NULL;
                  ^~~~~~~~
util/src/stir_shaken_ca.c:949:30: warning: unused variable 'sp_code' [-Wunused-variable]
      unsigned long long  int sp_code = 0;
                              ^~~~~~~
util/src/stir_shaken_ca.c:947:18: warning: unused variable 'spc_str' [-Wunused-variable]
      const char *spc_str = NULL;
                  ^~~~~~~
util/src/stir_shaken_ca.c:945:12: warning: unused variable 'token' [-Wunused-variable]
      char *token = NULL;
            ^~~~~
util/src/stir_shaken_ca.c:833:6: warning: unused variable 'args_n' [-Wunused-variable]
  int args_n = 0;
      ^~~~~~
util/src/stir_shaken_ca.c:832:11: warning: unused variable 'authz_secret' [-Wunused-variable]
  uint32_t authz_secret = 0;
           ^~~~~~~~~~~~
util/src/stir_shaken_ca.c:825:8: warning: unused variable 'token' [-Wunused-variable]
  char *token = NULL;
        ^~~~~
util/src/stir_shaken_ca.c:823:8: warning: unused variable 'pCh' [-Wunused-variable]
  char *pCh = NULL;
        ^~~
util/src/stir_shaken_ca.c: In function 'ca_handle_api_authority_check':
util/src/stir_shaken_ca.c:1174:6: warning: unused variable 'authority_check' [-Wunused-variable]
  int authority_check = 0;
      ^~~~~~~~~~~~~~~
util/src/stir_shaken_ca.c: In function 'ca_event_handler':
util/src/stir_shaken_ca.c:1311:18: warning: unused variable 'port_i' [-Wunused-variable]
     unsigned int port_i = 0;
                  ^~~~~~
util/src/stir_shaken_ca.c: In function 'stir_shaken_run_ca_service':
util/src/stir_shaken_ca.c:1373:31: warning: variable 'opts' set but not used [-Wunused-but-set-variable]
  struct mg_http_endpoint_opts opts = { 0 };
                               ^~~~
At top level:
util/src/stir_shaken_ca.c:211:13: warning: 'ca_handle_bad_request' defined but not used [-Wunused-function]
 static void ca_handle_bad_request(struct mg_connection *nc, int event, void *hm, void *d)
             ^~~~~~~~~~~~~~~~~~~~~
util/src/mongoose.c: In function 'mg_send_ssi_file.part.44':
util/src/mongoose.c:9340:40: warning: '__builtin___snprintf_chk' output may be truncated before the last format character [-Wformat-truncation=]
     snprintf(path, sizeof(path), "%s/%s", opts->document_root, file_name);
                                        ^
In file included from /usr/include/stdio.h:873,
                 from util/include/mongoose.h:409,
                 from util/src/mongoose.c:20:
/usr/include/bits/stdio2.h:68:10: note: '__builtin___snprintf_chk' output 2 or more bytes (assuming 4097) into a destination of size 4096
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __glibc_objsize (__s), __fmt,
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~
util/src/stir_shaken_ca.c: In function 'ca_handle_api_authz':
util/src/stir_shaken_ca.c:1088:74: warning: '%s' directive output may be truncated writing up to 999 bytes into a region of size 997 [-Wformat-truncation=]
       snprintf(session->sp.cert_name, sizeof(session->sp.cert_name), "sp_%s_%llu_%zu.pem", spc, secret, time(NULL));
                                                                          ^~                ~~~
util/src/stir_shaken_ca.c:1088:70: note: using the range [0, 18446744073709551615] for directive argument
       snprintf(session->sp.cert_name, sizeof(session->sp.cert_name), "sp_%s_%llu_%zu.pem", spc, secret, time(NULL));
                                                                      ^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:873,
                 from include/stir_shaken.h:8,
                 from util/src/stir_shaken_ca.c:1:
/usr/include/bits/stdio2.h:68:10: note: '__builtin___snprintf_chk' output between 12 and 1049 bytes into a destination of size 1000
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __glibc_objsize (__s), __fmt,
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~
  CC       util/src/stirshaken-mongoose.o
  CC       src/stir_shaken.lo
  CC       src/stir_shaken_service.lo
util/src/mongoose.c: In function 'mg_send_ssi_file.part.44':
util/src/mongoose.c:9340:40: warning: '__builtin___snprintf_chk' output may be truncated before the last format character [-Wformat-truncation=]
     snprintf(path, sizeof(path), "%s/%s", opts->document_root, file_name);
                                        ^
In file included from /usr/include/stdio.h:873,
                 from util/include/mongoose.h:409,
                 from util/src/mongoose.c:20:
/usr/include/bits/stdio2.h:68:10: note: '__builtin___snprintf_chk' output 2 or more bytes (assuming 4097) into a destination of size 4096
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __glibc_objsize (__s), __fmt,
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~
  CC       src/stir_shaken_passport.lo
  CC       src/stir_shaken_verify.lo
  CC       src/stir_shaken_ssl.lo
  CC       src/stir_shaken_acme.lo
  CC       src/stir_shaken_sp.lo
  CC       src/stir_shaken_version.lo
  CC       examples/stir_shaken_as_basic-stir_shaken_as_basic.o
examples/stir_shaken_as_basic.c: In function 'main':
examples/stir_shaken_as_basic.c:17:6: warning: unused variable 'ret' [-Wunused-variable]
  int ret = 0;
      ^~~
  CC       examples/stir_shaken_vs_basic-stir_shaken_vs_basic.o
  CC       examples/stir_shaken_ca-stir_shaken_ca.o
  CCLD     libstirshaken.la
  CCLD     stirshaken
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

1 participant