Disable used-but-marked-unused warnings in System.Security.Cryptography.Native
authorOmair Majid <omajid@redhat.com>
Thu, 7 Mar 2019 06:13:49 +0000 (01:13 -0500)
committerJeremy Barton <jbarton@microsoft.com>
Thu, 7 Mar 2019 06:13:49 +0000 (22:13 -0800)
commit5853431952c30b688832018e43238fc4ab9f52b6
tree714bdb0c989f2f30c4129758ba86a2fa31eb6840
parentd9311f4d7fa55610e24a4b05638f428f9f45b870
Disable used-but-marked-unused warnings in System.Security.Cryptography.Native

When building in non-portable mode, some OpenSSL 1.1 function defnitions
that are marked as unused can be picked up by our build. When those
functions are called, clang reports a warning and fails the build:

    src/Native/Unix/System.Security.Cryptography.Native/openssl.c:432:12:
    error: 'sk_ASN1_OBJECT_num' was marked unused but was used [-Werror,-Wused-but-marked-unused]
          return sk_ASN1_OBJECT_num(eku);
                 ^

This 'unused' attribute was recently added to sk_* methods in OpenSSL
1.1: https://github.com/openssl/openssl/pull/8246

Fixes dotnet/corefx#35807

Commit migrated from https://github.com/dotnet/corefx/commit/4819ac49f2e82158baeb464c56f4cd206da1bfec
src/libraries/Native/Unix/System.Security.Cryptography.Native/CMakeLists.txt