Closed Bug 1561332 Opened 5 years ago Closed 5 years ago

ec.c:28 warning: comparison of integers of different signs: 'int' and 'unsigned long'

Categories

(NSS :: Build, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: hi.himanshu14, Assigned: hi.himanshu14)

Details

Attachments

(1 file, 2 obsolete files)

Attached patch ec.c (obsolete) — Splinter Review

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36

Steps to reproduce:

Build warning noticed while compiling Mozilla-central.
In for loop sizeof(kMethod) produced unsigned long that compare with signed int 'i' that is an iterator.
The compiler will cast 'i' as unsigned long before doing the comparison.

Actual results:

The compiler will cast 'i' as unsigned long before doing the comparison.

Expected results:

initialize 'i' iterator with unsigned long so, the compiler doesn't have to take the load for it or doesn't have to cast it at compile time every time.

Attachment #9073864 - Attachment is patch: true
Attachment #9073864 - Attachment mime type: text/x-csrc → text/plain
Priority: -- → P2

I have fix for this bug, can i push it.

I have fix for this bug, can i push it.

I have fix for this bug, can i push it.

Attachment #9073864 - Flags: review?(kjacobs.bugzilla)
Assignee: nobody → hi.himanshu14
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Thanks for the report. Could you please attach your patch above? The current attachment does not seem to contain any changes.

Flags: needinfo?(hi.himanshu14)
Comment on attachment 9073864 [details] [diff] [review] ec.c Not a diff/no changes included
Attachment #9073864 - Flags: review?(kjacobs.bugzilla) → review-
Attached file ec.c (obsolete) —

Warning Fixed file

Flags: needinfo?(hi.himanshu14)
Attachment #9075882 - Flags: review+
Attachment #9075882 - Flags: feedback+
Attachment #9075882 - Flags: data-review+

(In reply to Kevin Jacobs [:kjacobs] from comment #4)

Thanks for the report. Could you please attach your patch above? The current attachment does not seem to contain any changes.

Done

Comment on attachment 9075882 [details] ec.c Note: what we generally expect is the output of `hg diff` -- a patch file, not the whole file.
Attachment #9075882 - Flags: review?(kjacobs.bugzilla)
Attachment #9075882 - Flags: review+
Attachment #9075882 - Flags: feedback+
Attachment #9075882 - Flags: data-review+
Attachment #9073864 - Attachment is obsolete: true
Attached patch ec.patchSplinter Review

Attaching diff of the patched file, r+

Attachment #9075882 - Attachment is obsolete: true
Attachment #9075882 - Flags: review?(kjacobs.bugzilla)
Attachment #9077166 - Flags: review+
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 3.46
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: