ruby / openssl

Provides SSL, TLS and general purpose cryptography.
Other
240 stars 167 forks source link

Build failure with FreeBSD 13.3 #801

Closed hsbt closed 2 months ago

hsbt commented 2 months ago

from https://bugs.ruby-lang.org/issues/20733

compiling ossl_digest.c
ossl_digest.c:66:14: warning: call to undeclared function 'EVP_MD_CTX_get0_md'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   66 |         md = EVP_MD_CTX_get0_md(ctx);
      |              ^
ossl_digest.c:66:12: error: incompatible integer to pointer conversion assigning to 'const EVP_MD *' (aka 'const struct evp_md_st *') from 'int' [-Wint-conversion]
   66 |         md = EVP_MD_CTX_get0_md(ctx);
      |            ^ ~~~~~~~~~~~~~~~~~~~~~~~
ossl_digest.c:206:32: warning: call to undeclared function 'EVP_MD_CTX_get0_md'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  206 |     if (EVP_DigestInit_ex(ctx, EVP_MD_CTX_get0_md(ctx), NULL) != 1) {
      |                                ^
ossl_digest.c:206:32: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const EVP_MD *' (aka 'const struct evp_md_st *') [-Wint-conversion]
  206 |     if (EVP_DigestInit_ex(ctx, EVP_MD_CTX_get0_md(ctx), NULL) != 1) {
      |                                ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/openssl/evp.h:550:61: note: passing argument to parameter 'type' here
  550 | __owur int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type,
      |                                                             ^
ossl_digest.c:290:40: warning: call to undeclared function 'EVP_MD_CTX_get0_md'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  290 |     return rb_str_new_cstr(EVP_MD_name(EVP_MD_CTX_get0_md(ctx)));
      |                                        ^
ossl_digest.c:290:40: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const EVP_MD *' (aka 'const struct evp_md_st *') [-Wint-conversion]
  290 |     return rb_str_new_cstr(EVP_MD_name(EVP_MD_CTX_get0_md(ctx)));
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/openssl/evp.h:447:64: note: expanded from macro 'EVP_MD_name'
  447 | # define EVP_MD_name(e)                  OBJ_nid2sn(EVP_MD_nid(e))
      |                                                                ^
/usr/include/openssl/evp.h:446:54: note: expanded from macro 'EVP_MD_nid'
  446 | # define EVP_MD_nid(e)                   EVP_MD_type(e)
      |                                                      ^
../.././include/ruby/internal/intern/string.h:1515:25: note: expanded from macro 'rb_str_new_cstr'
 1515 |     ((RBIMPL_CONSTANT_P(str) ?                  \
      |                         ^~~
../.././include/ruby/internal/constant_p.h:33:55: note: expanded from macro 'RBIMPL_CONSTANT_P'
   33 | # define RBIMPL_CONSTANT_P(expr) __builtin_constant_p(expr)
      |                                                       ^~~~
/usr/include/openssl/evp.h:445:31: note: passing argument to parameter 'md' here
  445 | int EVP_MD_type(const EVP_MD *md);
      |                               ^
ossl_digest.c:290:40: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const EVP_MD *' (aka 'const struct evp_md_st *') [-Wint-conversion]
  290 |     return rb_str_new_cstr(EVP_MD_name(EVP_MD_CTX_get0_md(ctx)));
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/openssl/evp.h:447:64: note: expanded from macro 'EVP_MD_name'
  447 | # define EVP_MD_name(e)                  OBJ_nid2sn(EVP_MD_nid(e))
      |                                                                ^
/usr/include/openssl/evp.h:446:54: note: expanded from macro 'EVP_MD_nid'
  446 | # define EVP_MD_nid(e)                   EVP_MD_type(e)
      |                                                      ^
../.././include/ruby/internal/intern/string.h:1517:25: note: expanded from macro 'rb_str_new_cstr'
 1517 |       rb_str_new_cstr) (str))
      |                         ^~~
/usr/include/openssl/evp.h:445:31: note: passing argument to parameter 'md' here
  445 | int EVP_MD_type(const EVP_MD *md);
      |                               ^
3 warnings and 4 errors generated.
junaruga commented 2 months ago

It seems that this issue was fixed on the above linked Ruby ticket. So, I would close this ticket. Feel free to reopen if the issue exists. https://bugs.ruby-lang.org/issues/20733#note-1