build error: 'DER_Lengths' : cannot convert parameter 3 from 'uint32 *' to 'PRUint32

RESOLVED FIXED

Status

()

Core
Security: PSM
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: surkov, Assigned: kaie)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
Created attachment 272281 [details] [diff] [review]
patch

http://lxr.mozilla.org/mozilla/source/security/manager/ssl/src/nsNSSIOLayer.cpp#1576
uses old version of DER_Lengths method with uint32 argument type (see bug 90426). I get the following compile error:

c:/Mozilla\mozilla\security\manager\ssl\src\nsNSSIOLayer.cpp(1576) : error
C2664: 'DER_Lengths' : cannot convert parameter 3 from 'uint32 *' to 'PRUint32
*'
        Types pointed to are unrelated; conversion requires reinterpret_cast,
C-style cast or function-style cast
make[6]: *** [nsNSSIOLayer.obj] Error 2
Attachment #272281 - Flags: review?(rrelyea)
(Assignee)

Comment 1

10 years ago
Alexander, can you please be more specific what combination of 
  PSM version (like Mozilla 1.8 branch or trunk) 
and
  NSS version (like 3.11 or 3.12)
you used when you ran into this build error?
(Reporter)

Comment 2

10 years ago
(In reply to comment #1)
> Alexander, can you please be more specific what combination of 
>   PSM version (like Mozilla 1.8 branch or trunk) 
> and
>   NSS version (like 3.11 or 3.12)
> you used when you ran into this build error?
> 

I have trunk sources that I got by cvs update (not by make checkout). So I assume PSM and NSS versions are latests. How can I ensure in versions of NSS/PSM?
(Assignee)

Comment 3

10 years ago
If you checked out Mozilla trunk, then yes, the contents of mozilla/security/manager (PSM) should be trunk, too.

NSS_CO_TAG in mozilla/client.mk defines the version that you check out.
You can also look at mozilla/security/nss/lib/nss/nss.h


When I looked at this patch first, I assumed some kind of incompatibility.

Alexander, in your build, did you set warnings to be fatal and treated as errors?
(Assignee)

Comment 4

10 years ago
I'm trying to understand why I don't get this error.

Comment 5

10 years ago
Comment on attachment 272281 [details] [diff] [review]
patch

The patch looks fine to me (in fact seems more correct).

I've added kai in the review since he's already started looking at it and it's in PSM.
Attachment #272281 - Flags: superreview?(kengert)
Attachment #272281 - Flags: review?(rrelyea)
Attachment #272281 - Flags: review+
(Reporter)

Comment 6

10 years ago
(In reply to comment #3)
> If you checked out Mozilla trunk, then yes, the contents of
> mozilla/security/manager (PSM) should be trunk, too.
> NSS_CO_TAG in mozilla/client.mk defines the version that you check out.

NSS_3_11_7_WITH_CKBI_1_64_RTM

but I didn't use make checkout to check out sources.

> You can also look at mozilla/security/nss/lib/nss/nss.h

#define NSS_VERSION  "3.12" _NSS_ECC_STRING " Beta" _NSS_CUSTOMIZED
#define NSS_VMAJOR   3
#define NSS_VMINOR   12
#define NSS_VPATCH   0
#define NSS_BETA     PR_TRUE

Is it those you asked for?

> 
> When I looked at this patch first, I assumed some kind of incompatibility.
> 
> Alexander, in your build, did you set warnings to be fatal and treated as
> errors?
> 

I think no. How can I check this?
(Assignee)

Comment 7

10 years ago
This still confuses me.
In both NSS 3.11 branch and NSS 3.12 function DER_Lengths is declared as:

mozilla/security/nss/lib/util/secder.h:
  extern SECStatus DER_Lengths(SECItem *item, 
                               int *header_len_p, 
                               uint32 *contents_len_p);

Both NSS and PSM use the same "type name" uint32 for parameter 3.
But the compiler complains there is a difference.

Why is it necessary to change PSM to use PRUint32?
Shouldn't uint32 and PRUint32 *always* be equivalent?

From the compiler error in comment 0 I conclude:

- while compiling the NSS header, 
    uint32 is equivalent to PRUint32

- while compiling the PSM source,
    uint32 is something else

I think that's a mistake. Why is that?
(Reporter)

Comment 8

10 years ago
(In reply to comment #7)
> This still confuses me.
> In both NSS 3.11 branch and NSS 3.12 function DER_Lengths is declared as:
> 
> mozilla/security/nss/lib/util/secder.h:
>   extern SECStatus DER_Lengths(SECItem *item, 
>                                int *header_len_p, 
>                                uint32 *contents_len_p);

It's that NSS version for that bug 90426 was checked in. There they use PRUint32 for third argument of DER_Lengths().

> Why is it necessary to change PSM to use PRUint32?
> Shouldn't uint32 and PRUint32 *always* be equivalent?

They are equivalent, but it seems uint32* and PRUint32* are different things.

Comment 9

10 years ago
Alexander, what specific compiler version are you using ?
(Reporter)

Comment 10

10 years ago
(In reply to comment #9)
> Alexander, what specific compiler version are you using ?
> 

VC 7.1 (2003)
(Assignee)

Comment 11

10 years ago
Comment on attachment 272281 [details] [diff] [review]
patch

This still confuses me, but I'm fine with this change.

On Linux, I do not get a warning or error, neither with uint32 nor with PRUint32
Attachment #272281 - Flags: superreview?(kengert) → superreview+
(Reporter)

Updated

10 years ago
Attachment #272281 - Flags: approval1.9?
(Assignee)

Updated

10 years ago
Blocks: 397296

Comment 12

10 years ago
    It looks like alexander is using the actual tip of NSS (this could happen by
    doing a cvs update -A in the mozilla/security tree).

    The NSS change was maked to rev 1.9 of mozilla/security/nss/lib/util/secder.h.
    This patch needs to land at the same time ans the NSS alpha 2 update.

    bob


(Assignee)

Comment 13

10 years ago
Comment on attachment 272281 [details] [diff] [review]
patch

Removing approval request, this got approved and checked in with bug 397296
Attachment #272281 - Flags: approval1.9?
(Assignee)

Comment 14

10 years ago
marking fixed with the check in from bug 397296
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
(Reporter)

Comment 15

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