Hello! Looks like we're using your software, so thanks before anything else.
I have been looking into this series of warnings thrown when running some python commands, which complained about several global variables not having the extern keyword. I'm adding the warnings below.
I finally troubleshooted it down to your code, and temporarily fixed it by the obvious solution of adding the keyword where necessary.
My question is, do you think we should actually use extern here? I am not knowledgable about this domain, so any kind of information would be helpful. I'd be happy to open a PR.
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecPaddingKey' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecPaddingPKCS7Key' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecPaddingPKCS5Key' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecPaddingPKCS1Key' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecPaddingOAEPKey' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecPaddingNoneKey' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecModeCBCKey' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecTransformInputAttributeName' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecDigestTypeAttribute' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecDigestLengthAttribute' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecIVKey' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecAttrIsExtractable' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecDigestSHA1' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecDigestSHA2' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecDigestMD5' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecAttrKeyType' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecAttrKeyTypeRSA' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecAttrKeyTypeDSA' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecAttrKeyTypeECDSA' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecAttrKeySizeInBits' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecAttrLabel' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecAttrCanSign' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecAttrCanVerify' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecAttrKeyTypeAES' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecAttrKeyTypeRC4' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecAttrKeyTypeRC2' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecAttrKeyType3DES' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kSecAttrKeyTypeDES' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kCFAllocatorDefault' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kCFTypeArrayCallBacks' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kCFBooleanTrue' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kCFTypeDictionaryKeyCallBacks' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
/Users/erinc/.virtualenvs/findapro/lib/python3.6/site-packages/cffi/cparser.py:164: UserWarning: Global variable 'kCFTypeDictionaryValueCallBacks' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
"(usually 'extern')" % (decl.name,))
Hello! Looks like we're using your software, so thanks before anything else.
I have been looking into this series of warnings thrown when running some python commands, which complained about several global variables not having the
extern
keyword. I'm adding the warnings below.I finally troubleshooted it down to your code, and temporarily fixed it by the obvious solution of adding the keyword where necessary.
My question is, do you think we should actually use
extern
here? I am not knowledgable about this domain, so any kind of information would be helpful. I'd be happy to open a PR.Files affected:
Thanks!
The warning avalanche: