Closed Bug 1413632 Opened 7 years ago Closed 7 years ago

poly1305.h uses type "size_t" without the header to define it

Categories

(NSS :: Libraries, defect, P5)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dholbert, Assigned: dholbert)

Details

Attachments

(1 file)

The header poly1305.h (added in bug 917571) uses the type "size_t" without #including the appropriate header to define this type.

This normally seems to work out OK (given that it hasn't broken the build), but it's still kind of bad, and under nonstandard configurations, it can cause a compile error for size_t being undefined.[1]

Let's just include the correct header, which is stddef.h according to these references:
 https://en.wikipedia.org/wiki/C_data_types#stddef.h
 http://tigcc.ticalc.org/doc/stddef.html
 http://en.cppreference.com/w/cpp/types/size_t


[1] I hit this compile error when building mozilla-central with "-ffreestanding" in my CFLAGS, over in bug 1412240.
Attached patch fix v1Splinter Review
Attachment #8924242 - Flags: review?(ttaubert)
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Comment on attachment 8924242 [details] [diff] [review]
fix v1

>diff --git a/lib/freebl/poly1305.h b/lib/freebl/poly1305.h
[...
> /* Poly1305Update processes |in_len| bytes from |in|. It can be called zero or
>  * more times after poly1305_init. */
> extern void Poly1305Update(poly1305_state* state, const unsigned char* in,
>                            size_t inLen);
    .------------------------^^^^^^
This' is the size_t usage being discussed here, BTW (shown in the last line of the patch context).
Comment on attachment 8924242 [details] [diff] [review]
fix v1

Review of attachment 8924242 [details] [diff] [review]:
-----------------------------------------------------------------

Let's add it, thanks!
Attachment #8924242 - Flags: review?(ttaubert) → review+
https://hg.mozilla.org/projects/nss/rev/229e236d1ca7
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.35
Thanks for the review & landing!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: