Source code pulled from OpenBSD for LibreSSL - this includes most of the library and supporting code. The place to contribute to this code is via the OpenBSD CVS tree. Please mail patches to tech@openbsd.org, instead of submitting pull requests, since this tree is often rebased.
The header bn.h defines the function BN_print differently depending whether bio.h is included:
#ifdef HEADER_BIO_H
int BN_print(BIO *fp, const BIGNUM *a);
#else
int BN_print(void *fp, const BIGNUM *a);
#endif
Only one type is allowable for BN_print, the type with which the function is defined (C11 6.2.7:2 “All declarations that refer to the same object or function shall have compatible type; otherwise, the behavior is undefined”). The types void * and BIO * are not compatible, and neither are the types of functions taking one or the other as argument.
Does anyone know what problem the hack above is supposed to solve and whether it is still useful?
The header
bn.h
defines the functionBN_print
differently depending whetherbio.h
is included:Only one type is allowable for
BN_print
, the type with which the function is defined (C11 6.2.7:2 “All declarations that refer to the same object or function shall have compatible type; otherwise, the behavior is undefined”). The typesvoid *
andBIO *
are not compatible, and neither are the types of functions taking one or the other as argument.Does anyone know what problem the hack above is supposed to solve and whether it is still useful?