Get rid of: type qualifiers ignored on function return type [-Wignored-qualifiers]
Status: Beta
Brought to you by:
kagoldman
When compiling, I get the warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
This is caused by a const
qualifier for CryptGetHashDef
. The warning (as I understand it) means, that it can't be guaranteed that the returned type is always const. So it might as well be removed.
Proposed changes:
*** src/VBox/Devices/Security/CryptHash_fp.h 2017-01-19 22:51:57.357290060 +0100 --- src/VBox/Devices/Security/CryptHash_fp.h 2017-01-19 22:59:55.660089240 +0100 *************** *** 70,76 **** CryptHashStartup( void ); ! const PHASH_DEF CryptGetHashDef( TPM_ALG_ID hashAlg ); --- 70,76 ---- CryptHashStartup( void ); ! PHASH_DEF CryptGetHashDef( TPM_ALG_ID hashAlg ); *** src/VBox/Devices/Security/CryptHash.c 2017-01-19 22:52:18.657589711 +0100 --- src/VBox/Devices/Security/CryptHash.c 2017-01-19 22:59:19.751577285 +0100 *************** *** 102,108 **** /* 10.2.14.4.2 CryptGetHashDef() */ /* This function accesses the hash descriptor associated with a hash a algorithm. The function returns NULL for TPM_ALG_NULL and fails if hashAlg is not a hash algorithm. */ ! const PHASH_DEF CryptGetHashDef( TPM_ALG_ID hashAlg ) --- 102,108 ---- /* 10.2.14.4.2 CryptGetHashDef() */ /* This function accesses the hash descriptor associated with a hash a algorithm. The function returns NULL for TPM_ALG_NULL and fails if hashAlg is not a hash algorithm. */ ! PHASH_DEF CryptGetHashDef( TPM_ALG_ID hashAlg )
Someone else found this as well. It's that PHASH_DEF is already a const. It doesn't cause any TPM malfunction, but it will be fixed.