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

Fails to build on 32bit Gentoo #117

Open
mrtrev opened this issue Dec 3, 2021 · 3 comments
Open

Fails to build on 32bit Gentoo #117

mrtrev opened this issue Dec 3, 2021 · 3 comments

Comments

@mrtrev
Copy link
Contributor

mrtrev commented Dec 3, 2021

  CC       util/src/stirshaken-stir_shaken_tool_command.o
  CC       util/src/stirshaken-stir_shaken_tool.o
  CC       util/src/stirshaken-stir_shaken_ca.o
util/src/stir_shaken_ca.c: In function ‘close_http_connection_with_error’:
util/src/stir_shaken_ca.c:128:84: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=]
  128 |                                 mg_printf(nc, "HTTP/1.1 %s %s\r\nContent-Length: %lu\r\nContent-Type: application/json\r\n\r\n%s\r\n\r\n", STIR_SHAKEN_HTTP_REQ_404_NOT_FOUND, error_phrase, strlen(error_body), error_body);
      |                                                                                  ~~^                                                                                                         ~~~~~~~~~~~~~~~~~~
      |                                                                                    |                                                                                                         |
      |                                                                                    long unsigned int                                                                                         size_t {aka unsigned int}
      |                                                                                  %u
util/src/stir_shaken_ca.c: In function ‘ca_handle_api_cert’:
util/src/stir_shaken_ca.c:536:134: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=]
  536 |                                         mg_printf(nc, "HTTP/1.1 201 Created\r\nReplay-Nonce: %s\r\nLocation: %s\r\nContent-Length: %lu\r\nContent-Type: application/json\r\n\r\n%s\r\n\r\n", nonce, authz_url, strlen(authz_challenge), authz_challenge);
      |                                                                                                                                    ~~^                                                                         ~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                                                                                      |                                                                         |
      |                                                                                                                                      long unsigned int                                                         size_t {aka unsigned int}
      |                                                                                                                                    %u
util/src/stir_shaken_ca.c:598:93: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=]
  598 |                                         mg_printf(nc, "HTTP/1.1 200 OK\r\nContent-Length: %lu\r\nContent-Type: application/json\r\n\r\n%s\r\n\r\n", strlen((const char *)cert), cert);
      |                                                                                           ~~^                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                                             |                                                       |
      |                                                                                             long unsigned int                                       size_t {aka unsigned int}
      |                                                                                           %u
util/src/stir_shaken_ca.c: In function ‘ca_handle_api_authz’:
util/src/stir_shaken_ca.c:900:101: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=]
  900 |                                                 mg_printf(nc, "HTTP/1.1 200 OK\r\nContent-Length: %lu\r\nContent-Type: application/json\r\n\r\n%s\r\n\r\n", strlen(session->authz_polling_status), session->authz_polling_status);
      |                                                                                                   ~~^                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                                                     |                                                       |
      |                                                                                                     long unsigned int                                       size_t {aka unsigned int}
      |                                                                                                   %u
util/src/stir_shaken_ca.c:931:149: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=]
  931 |                                                 mg_printf(nc, "HTTP/1.1 200 You are more than welcome. Here is your challenge:\r\nContent-Length: %lu\r\nContent-Type: application/json\r\n\r\n%s\r\n\r\n", strlen(session->authz_challenge_details), session->authz_challenge_details);
      |                                                                                                                                                   ~~^                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                                                                                                     |                                                       |
      |                                                                                                                                                     long unsigned int                                       size_t {aka unsigned int}
      |                                                                                                                                                   %u
util/src/stir_shaken_ca.c:1088:126: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 6 has type ‘time_t’ {aka ‘long int’} [-Wformat=]
 1088 |                                                 snprintf(session->sp.cert_name, sizeof(session->sp.cert_name), "sp_%s_%llu_%zu.pem", spc, secret, time(NULL));
      |                                                                                                                            ~~^                    ~~~~~~~~~~
      |                                                                                                                              |                    |
      |                                                                                                                              unsigned int         time_t {aka long int}
      |                                                                                                                            %lu
util/src/stir_shaken_ca.c: In function ‘ca_handle_api_authority_check’:
util/src/stir_shaken_ca.c:1237:85: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=]
 1237 |                                 mg_printf(nc, "HTTP/1.1 200 OK\r\nContent-Length: %lu\r\nContent-Type: application/json\r\n\r\n%s\r\n\r\n", strlen(json_str), json_str);
      |                                                                                   ~~^                                                       ~~~~~~~~~~~~~~~~
      |                                                                                     |                                                       |
      |                                                                                     long unsigned int                                       size_t {aka unsigned int}
      |                                                                                   %u
  CC       util/src/stirshaken-mongoose.o
  CC       src/stir_shaken.lo
  CC       src/stir_shaken_service.lo
  CC       src/stir_shaken_passport.lo
src/stir_shaken_passport.c: In function ‘stir_shaken_passport_validate_iat_against_freshness’:
src/stir_shaken_passport.c:818:98: error: format ‘%zu’ expects argument of type ‘size_t’, but argument 4 has type ‘time_t’ {aka ‘long int’} [-Werror=format=]
  818 |                 snprintf(err_buf, STIR_SHAKEN_ERROR_BUF_LEN, "PASSporT's @iat (in seconds) is: %zu, freshness is: %u, BUT now is %zu (this is PASSporT to the future, too young, not valid yet)", iat, iat_freshness, now_s);
      |                                                                                                ~~^                                                                                                ~~~
      |                                                                                                  |                                                                                                |
      |                                                                                                  unsigned int                                                                                     time_t {aka long int}
      |                                                                                                %lu
src/stir_shaken_passport.c:818:132: error: format ‘%zu’ expects argument of type ‘size_t’, but argument 6 has type ‘time_t’ {aka ‘long int’} [-Werror=format=]
  818 |                 snprintf(err_buf, STIR_SHAKEN_ERROR_BUF_LEN, "PASSporT's @iat (in seconds) is: %zu, freshness is: %u, BUT now is %zu (this is PASSporT to the future, too young, not valid yet)", iat, iat_freshness, now_s);
      |                                                                                                                                  ~~^                                                                                  ~~~~~
      |                                                                                                                                    |                                                                                  |
      |                                                                                                                                    unsigned int                                                                       time_t {aka long int}
      |                                                                                                                                  %lu
src/stir_shaken_passport.c:824:98: error: format ‘%zu’ expects argument of type ‘size_t’, but argument 4 has type ‘time_t’ {aka ‘long int’} [-Werror=format=]
  824 |                 snprintf(err_buf, STIR_SHAKEN_ERROR_BUF_LEN, "PASSporT's @iat (in seconds) is: %zu, freshness is: %u, BUT now is %zu (PASSporT too old, expired)", iat, iat_freshness, now_s);
      |                                                                                                ~~^                                                                 ~~~
      |                                                                                                  |                                                                 |
      |                                                                                                  unsigned int                                                      time_t {aka long int}
      |                                                                                                %lu
src/stir_shaken_passport.c:824:132: error: format ‘%zu’ expects argument of type ‘size_t’, but argument 6 has type ‘time_t’ {aka ‘long int’} [-Werror=format=]
  824 |                 snprintf(err_buf, STIR_SHAKEN_ERROR_BUF_LEN, "PASSporT's @iat (in seconds) is: %zu, freshness is: %u, BUT now is %zu (PASSporT too old, expired)", iat, iat_freshness, now_s);
      |                                                                                                                                  ~~^                                                   ~~~~~
      |                                                                                                                                    |                                                   |
      |                                                                                                                                    unsigned int                                        time_t {aka long int}
      |                                                                                                                                  %lu
src/stir_shaken_passport.c: At top level:
cc1: note: unrecognized command-line option ‘-Wno-gnu-zero-variadic-macro-arguments’ may have been intended to silence earlier diagnostics
cc1: all warnings being treated as errors
make: *** [Makefile:1336: src/stir_shaken_passport.lo] Error 1
@mrtrev
Copy link
Contributor Author

mrtrev commented Nov 13, 2022

Can we please merge this PR so I don't have to keep patching manually?

@crienzo
Copy link
Member

crienzo commented Nov 14, 2022

You still have some unresolved questions in that PR.

@mrtrev
Copy link
Contributor Author

mrtrev commented Nov 30, 2022

It's not my PR, but I came up with a similar patch that I'm using locally to solve this issue.

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

2 participants