Closed Bug 1577657 Opened 5 years ago Closed 5 years ago

Address MSVC warning C4312

Categories

(NSS :: Libraries, defect, P3)

x86_64
Windows 10
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1573097

People

(Reporter: mt, Unassigned)

Details

(Keywords: good-first-bug)

Attachments

(1 file)

c:\code\nss\lib\ckfw\instance.c(796): warning C4312: 'type cast': conversion from 'CK_OBJECT_HANDLE' to 'const void *' of greater size

Right now, these warnings are not especially common, but there are a few files that generate quite a few. The problem is that we are putting an integer value into pointer slot. We do that to avoid an allocation (and the associated management). But we need to do two things:

  1. Ensure that CK_OBJECT_HANDLE (or whatever type is used) fits in void* with PR_STATIC_ASSERT.

  2. Wrap all these conversions with a macro that converts via uintptr_t.

  3. Turn these warnings into errors so we don't get more of them.

This is largely mechanical.

The complete set of warnings isn't that long: ```
Type: task → defect
Priority: -- → P3

I have a habit of opening duplicates of my own bugs.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: