Closed Bug 577471 Opened 14 years ago Closed 9 years ago

warning: unused variable ‘t1’ in SHA256_End

Categories

(NSS :: Libraries, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug)

Details

(Whiteboard: [build_warning])

Attachments

(1 file)

725 bytes, patch
timeless
: review?
nelson
Details | Diff | Splinter Review
ipc/chromium/src/base/third_party/nss/sha512.cc:
 In function ‘void nss::SHA256_End(SHA256Context*, unsigned char*, unsigned int*, unsigned int)’:
442: warning: unused variable ‘t1’

I know I found it while building ipc, but the same code is in nss, so the fix should be applied there...
Attached patch patchSplinter Review
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #456433 - Flags: review?(nelson)
Timeless,
I'd prefer a patch that brackets lines 100-142 with 
#if defined(IS_LITTLE_ENDIAN) 
if that works (compiles correctly on all platforms).
Here's another possibility:

-#else /* neither windows nor Linux PC */
+#elif defined(IS_LITTLE_ENDIAN)
 #define SWAP4MASK  0x00FF00FF
 #define SHA_HTONL(x) (t1 = (x), t1 = (t1 << 16) | (t1 >> 16), \
                       ((t1 & SWAP4MASK) << 8) | ((t1 >> 8) & SWAP4MASK))

Timeless, 
on what platform did you see this?
You filed this against MacOS x86, but that's a little endian platform.
You must have seen this on some big-endian platform.  What was it?
Can you test either of the above suggestions on that platform?
hrm, dunno. i use solaris-x86 and osx-ppc. the latter seems more likely, i probably built from my g5 via ssh from my mbp...
Whiteboard: [build_warning]
Blocks: buildwarning
All -Wunused-variable warnings in mozilla-central have been fixed.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: