Juan Lang wrote:
Yes, I know what the value of CRYPT_E_NOT_FOUND is, and what the type of GetLastError is. My point is, Microsoft confused signed and unsigned types for their last error values. We have to live with it.
Indeed. (And sorry, I didn't mean to sound patronizing.)
I don't think the cost of adding silly casts or temporaries to avoid giving a warning on a common code idiom is worth it.
That's the trouble with some warnings: some instances you want to fix and some you know you can safely ignore. I presumed that we were aiming to turn this warning on permanently, but that may not be the intention, and maybe the downside you highlight makes doing so not worthwhile.