Closed Bug 1796281 Opened 2 years ago Closed 2 years ago

-Wint-to-void-pointer-cast warnings in NSS

Categories

(NSS :: Libraries, defect)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(2 files)

On 64-bits Windows only:

[task 2022-10-19T08:33:37.365Z] 08:33:37    ERROR -  /builds/worker/checkouts/gecko/security/nss/lib/util/secoid.c(2121,37): error: cast to 'void *' from smaller integer type 'unsigned long' [-Werror,-Wint-to-void-pointer-cast]
[task 2022-10-19T08:33:37.365Z] 08:33:37     INFO -                                      (void *)oid->mechanism, (void *)oid);
[task 2022-10-19T08:33:37.365Z] 08:33:37     INFO -                                      ^~~~~~~~~~~~~~~~~~~~~~
[task 2022-10-19T08:33:37.366Z] 08:33:37    ERROR -  /builds/worker/checkouts/gecko/security/nss/lib/util/secoid.c(2142,48): error: cast to 'void *' from smaller integer type 'unsigned long' [-Werror,-Wint-to-void-pointer-cast]
[task 2022-10-19T08:33:37.366Z] 08:33:37     INFO -      ret = PL_HashTableLookupConst(oidmechhash, (void *)mechanism);
[task 2022-10-19T08:33:37.366Z] 08:33:37     INFO -                                                 ^~~~~~~~~~~~~~~~~
[task 2022-10-19T08:33:37.367Z] 08:33:37     INFO -  2 errors generated.
[task 2022-10-19T08:50:42.666Z] 08:50:42    ERROR -  /builds/worker/checkouts/gecko/security/nss/lib/ckfw/instance.c(550,31): error: cast to 'const void *' from smaller integer type 'CK_SESSION_HANDLE' (aka 'unsigned long') [-Werror,-Wint-to-void-pointer-cast]
[task 2022-10-19T08:50:42.666Z] 08:50:42     INFO -                                (const void *)hSession, (const void *)fwSession);
[task 2022-10-19T08:50:42.666Z] 08:50:42     INFO -                                ^~~~~~~~~~~~~~~~~~~~~~
[task 2022-10-19T08:50:42.666Z] 08:50:42    ERROR -  /builds/worker/checkouts/gecko/security/nss/lib/ckfw/instance.c(583,40): error: cast to 'const void *' from smaller integer type 'CK_SESSION_HANDLE' (aka 'unsigned long') [-Werror,-Wint-to-void-pointer-cast]
[task 2022-10-19T08:50:42.666Z] 08:50:42     INFO -          fwInstance->sessionHandleHash, (const void *)hSession);
[task 2022-10-19T08:50:42.666Z] 08:50:42     INFO -                                         ^~~~~~~~~~~~~~~~~~~~~~
[task 2022-10-19T08:50:42.666Z] 08:50:42    ERROR -  /builds/worker/checkouts/gecko/security/nss/lib/ckfw/instance.c(614,40): error: cast to 'const void *' from smaller integer type 'CK_SESSION_HANDLE' (aka 'unsigned long') [-Werror,-Wint-to-void-pointer-cast]
[task 2022-10-19T08:50:42.666Z] 08:50:42     INFO -          fwInstance->sessionHandleHash, (const void *)hSession);
[task 2022-10-19T08:50:42.667Z] 08:50:42     INFO -                                         ^~~~~~~~~~~~~~~~~~~~~~
[task 2022-10-19T08:50:42.667Z] 08:50:42    ERROR -  /builds/worker/checkouts/gecko/security/nss/lib/ckfw/instance.c(616,59): error: cast to 'const void *' from smaller integer type 'CK_SESSION_HANDLE' (aka 'unsigned long') [-Werror,-Wint-to-void-pointer-cast]
[task 2022-10-19T08:50:42.667Z] 08:50:42     INFO -          nssCKFWHash_Remove(fwInstance->sessionHandleHash, (const void *)hSession);
[task 2022-10-19T08:50:42.667Z] 08:50:42     INFO -                                                            ^~~~~~~~~~~~~~~~~~~~~~
[task 2022-10-19T08:50:42.667Z] 08:50:42    ERROR -  /builds/worker/checkouts/gecko/security/nss/lib/ckfw/instance.c(685,31): error: cast to 'const void *' from smaller integer type 'CK_OBJECT_HANDLE' (aka 'unsigned long') [-Werror,-Wint-to-void-pointer-cast]
[task 2022-10-19T08:50:42.667Z] 08:50:42     INFO -                                (const void *)hObject, (const void *)fwObject);
[task 2022-10-19T08:50:42.667Z] 08:50:42     INFO -                                ^~~~~~~~~~~~~~~~~~~~~
[task 2022-10-19T08:50:42.668Z] 08:50:42    ERROR -  /builds/worker/checkouts/gecko/security/nss/lib/ckfw/instance.c(718,39): error: cast to 'const void *' from smaller integer type 'CK_OBJECT_HANDLE' (aka 'unsigned long') [-Werror,-Wint-to-void-pointer-cast]
[task 2022-10-19T08:50:42.668Z] 08:50:42     INFO -          fwInstance->objectHandleHash, (const void *)hObject);
[task 2022-10-19T08:50:42.668Z] 08:50:42     INFO -                                        ^~~~~~~~~~~~~~~~~~~~~
[task 2022-10-19T08:50:42.668Z] 08:50:42    ERROR -  /builds/worker/checkouts/gecko/security/nss/lib/ckfw/instance.c(752,39): error: cast to 'const void *' from smaller integer type 'CK_OBJECT_HANDLE' (aka 'unsigned long') [-Werror,-Wint-to-void-pointer-cast]
[task 2022-10-19T08:50:42.668Z] 08:50:42     INFO -          fwInstance->objectHandleHash, (const void *)hObject);
[task 2022-10-19T08:50:42.668Z] 08:50:42     INFO -                                        ^~~~~~~~~~~~~~~~~~~~~
[task 2022-10-19T08:50:42.668Z] 08:50:42    ERROR -  /builds/worker/checkouts/gecko/security/nss/lib/ckfw/instance.c(756,58): error: cast to 'const void *' from smaller integer type 'CK_OBJECT_HANDLE' (aka 'unsigned long') [-Werror,-Wint-to-void-pointer-cast]
[task 2022-10-19T08:50:42.668Z] 08:50:42     INFO -          nssCKFWHash_Remove(fwInstance->objectHandleHash, (const void *)hObject);
[task 2022-10-19T08:50:42.668Z] 08:50:42     INFO -                                                           ^~~~~~~~~~~~~~~~~~~~~
[task 2022-10-19T08:50:42.668Z] 08:50:42    ERROR -  /builds/worker/checkouts/gecko/security/nss/lib/ckfw/instance.c(764,29): error: cast to 'const void *' from smaller integer type 'CK_OBJECT_HANDLE' (aka 'unsigned long') [-Werror,-Wint-to-void-pointer-cast]
[task 2022-10-19T08:50:42.668Z] 08:50:42     INFO -                              (const void *)hObject, (const void *)fwObject);
[task 2022-10-19T08:50:42.668Z] 08:50:42     INFO -                              ^~~~~~~~~~~~~~~~~~~~~
[task 2022-10-19T08:50:42.668Z] 08:50:42    ERROR -  /builds/worker/checkouts/gecko/security/nss/lib/ckfw/instance.c(793,39): error: cast to 'const void *' from smaller integer type 'CK_OBJECT_HANDLE' (aka 'unsigned long') [-Werror,-Wint-to-void-pointer-cast]
[task 2022-10-19T08:50:42.669Z] 08:50:42     INFO -          fwInstance->objectHandleHash, (const void *)hObject);
[task 2022-10-19T08:50:42.669Z] 08:50:42     INFO -                                        ^~~~~~~~~~~~~~~~~~~~~
[task 2022-10-19T08:50:42.669Z] 08:50:42    ERROR -  /builds/worker/checkouts/gecko/security/nss/lib/ckfw/instance.c(796,58): error: cast to 'const void *' from smaller integer type 'CK_OBJECT_HANDLE' (aka 'unsigned long') [-Werror,-Wint-to-void-pointer-cast]
[task 2022-10-19T08:50:42.669Z] 08:50:42     INFO -          nssCKFWHash_Remove(fwInstance->objectHandleHash, (const void *)hObject);
[task 2022-10-19T08:50:42.669Z] 08:50:42     INFO -                                                           ^~~~~~~~~~~~~~~~~~~~~
[task 2022-10-19T08:50:42.669Z] 08:50:42     INFO -  11 errors generated.
[task 2022-10-19T08:50:53.323Z] 08:50:53    ERROR -  /builds/worker/checkouts/gecko/security/nss/lib/softoken/pkcs11.c(2623,48): error: cast to 'void *' from smaller integer type 'CK_SLOT_ID' (aka 'unsigned long') [-Werror,-Wint-to-void-pointer-cast]
[task 2022-10-19T08:50:53.324Z] 08:50:53     INFO -                                                 (void *)slotID);
[task 2022-10-19T08:50:53.324Z] 08:50:53     INFO -                                                 ^~~~~~~~~~~~~~
[task 2022-10-19T08:50:53.324Z] 08:50:53    ERROR -  /builds/worker/checkouts/gecko/security/nss/lib/softoken/pkcs11.c(2693,54): error: cast to 'void *' from smaller integer type 'CK_SLOT_ID' (aka 'unsigned long') [-Werror,-Wint-to-void-pointer-cast]
[task 2022-10-19T08:50:53.325Z] 08:50:53     INFO -      entry = PL_HashTableAdd(nscSlotHashTable[index], (void *)slot->slotID, slot);
[task 2022-10-19T08:50:53.325Z] 08:50:53     INFO -                                                       ^~~~~~~~~~~~~~~~~~~~
[task 2022-10-19T08:50:53.325Z] 08:50:53    ERROR -  /builds/worker/checkouts/gecko/security/nss/lib/softoken/pkcs11.c(3226,54): error: cast to 'void *' from smaller integer type 'CK_SLOT_ID' (aka 'unsigned long') [-Werror,-Wint-to-void-pointer-cast]
[task 2022-10-19T08:50:53.325Z] 08:50:53     INFO -                  PL_HashTableLookup(tmpSlotHashTable, (void *)slotID);
[task 2022-10-19T08:50:53.326Z] 08:50:53     INFO -                                                       ^~~~~~~~~~~~~~
[task 2022-10-19T08:50:53.326Z] 08:50:53    ERROR -  /builds/worker/checkouts/gecko/security/nss/lib/softoken/pkcs11.c(3231,50): error: cast to 'void *' from smaller integer type 'CK_SLOT_ID' (aka 'unsigned long') [-Werror,-Wint-to-void-pointer-cast]
[task 2022-10-19T08:50:53.326Z] 08:50:53     INFO -              PL_HashTableRemove(tmpSlotHashTable, (void *)slotID);
[task 2022-10-19T08:50:53.327Z] 08:50:53     INFO -                                                   ^~~~~~~~~~~~~~
[task 2022-10-19T08:50:53.327Z] 08:50:53    ERROR -  /builds/worker/checkouts/gecko/security/nss/lib/softoken/pkcs11.c(3246,61): error: cast to 'void *' from smaller integer type 'CK_SLOT_ID' (aka 'unsigned long') [-Werror,-Wint-to-void-pointer-cast]
[task 2022-10-19T08:50:53.327Z] 08:50:53     INFO -      slot = (SFTKSlot *)PL_HashTableLookup(tmpSlotHashTable, (void *)slotID);
[task 2022-10-19T08:50:53.328Z] 08:50:53     INFO -                                                              ^~~~~~~~~~~~~~
[task 2022-10-19T08:50:53.328Z] 08:50:53     INFO -  5 errors generated.
[task 2022-10-19T08:50:53.396Z] 08:50:53    ERROR -  /builds/worker/checkouts/gecko/security/nss/lib/softoken/pkcs11u.c(907,65): error: cast to 'void *' from smaller integer type 'CK_OBJECT_HANDLE' (aka 'unsigned long') [-Werror,-Wint-to-void-pointer-cast]
[task 2022-10-19T08:50:53.397Z] 08:50:53     INFO -      return (SECItem *)PL_HashTableLookup(slot->tokObjHashTable, (void *)handle);
[task 2022-10-19T08:50:53.397Z] 08:50:53     INFO -                                                                  ^~~~~~~~~~~~~~
[task 2022-10-19T08:50:53.397Z] 08:50:53     INFO -  1 error generated.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.85

A patch has been attached on this bug, which was already closed. Filing a separate bug will ensure better tracking. If this was not by mistake and further action is needed, please alert the appropriate party. (Or: if the patch doesn't change behavior -- e.g. landing a test case, or fixing a typo -- then feel free to disregard this message)

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: