libstirshaken
libstirshaken copied to clipboard
Fails to build on 32bit Gentoo
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
Can we please merge this PR so I don't have to keep patching manually?
You still have some unresolved questions in that PR.
It's not my PR, but I came up with a similar patch that I'm using locally to solve this issue.