Description of problem:
The new FIPS_mode() macros expands to EVP_default_properties_is_fips_enabled() which has a declaration in a different header file. This causes clang to emit the -Wimplicit-function-declaration warning when compiling applications that use the macro.
Version-Release number of selected component (if applicable):
openssl-3.0.2-5.fc36
How reproducible:
Always
Steps to Reproduce:
$ dnf install clang openssl-devel
$ cat fips-clang.c
#include <stdio.h>
#include <openssl/fips.h>
int main(int argc, char **argv) {
if (FIPS_mode())
printf("FIPS mode enabled\n");
return 0;
}
$ clang -Werror clang-fips.c
clang-fips.c:5:7: error: implicit declaration of function 'EVP_default_properties_is_fips_enabled' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
if (FIPS_mode())
^
/usr/include/openssl/fips.h:20:22: note: expanded from macro 'FIPS_mode'
# define FIPS_mode() EVP_default_properties_is_fips_enabled(NULL)
^
1 error generated.
Expected results:
Program compiles successfully.
Comment 1Dmitry Belyavskiy
2022-10-11 12:32:10 UTC
-Werror is not default compilation option, clang is not default compiler, and workaround exists. So closing.