Closed Bug 1661378 Opened 4 years ago Closed 4 years ago

Build failiure with Clang-11

Categories

(NSS :: Build, defect, P1)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: raj.khem, Assigned: raj.khem)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36

Steps to reproduce:

Building with clang-11 results in the following failure

Clang finds this error

pkix_logger.c:316:32: error: cast to smaller integer type 'PKIX_ERRORCLASS' from 'void *' [-Werror,-Wvoid-pointer-to-enum-cast]
        logger->logComponent = (PKIX_ERRORCLASS)NULL;
                               ^~~~~~~~~~~~~~~~~~~~~
pkix_logger.c:617:32: error: cast to smaller integer type 'PKIX_ERRORCLASS' from 'void *' [-Werror,-Wvoid-pointer-to-enum-cast]
        logger->logComponent = (PKIX_ERRORCLASS)NULL;
                               ^~~~~~~~~~~~~~~~~~~~~
2 errors generated.

Actual results:

resulted in error

Clang finds this error

pkix_logger.c:316:32: error: cast to smaller integer type 'PKIX_ERRORCLASS' from 'void *' [-Werror,-Wvoid-pointer-to-enum-cast]
        logger->logComponent = (PKIX_ERRORCLASS)NULL;
                               ^~~~~~~~~~~~~~~~~~~~~
pkix_logger.c:617:32: error: cast to smaller integer type 'PKIX_ERRORCLASS' from 'void *' [-Werror,-Wvoid-pointer-to-enum-cast]
        logger->logComponent = (PKIX_ERRORCLASS)NULL;
                               ^~~~~~~~~~~~~~~~~~~~~
2 errors generated.

Expected results:

successful compilation.

Attached patch FixSplinter Review
Assignee: nobody → raj.khem
Severity: -- → S4
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P1
Attachment #9172301 - Flags: review?(kjacobs.bugzilla)

Comment on attachment 9172301 [details] [diff] [review]
Fix

Thank you for the report and patch!

Attachment #9172301 - Flags: review?(kjacobs.bugzilla) → review+
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.57
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: