Fw: [Git][NTPsec/ntpsec][master] 2 commits: Some u_long -> unsigned int changes.

Joel Sherrill joel at rtems.org
Fri Sep 23 18:41:07 UTC 2016


On Fri, Sep 23, 2016 at 1:08 PM, Gary E. Miller <gem at rellim.com> wrote:

> Yo Eric!
>
>
> > These are valid because the invention and major uses of u_long in this
> > codebase predate the 64-bit transition - it may look like we're
> > narrowing size from 64 to 32 bits, but what we're actually doing is
> > replacing an earlier hack for guaranteeing 32-bit size by people
> > who cut their teeth on 16-bit ints.
>
> I disagree with this patch.
>
> -extern void    authtrust       (keyid_t, unsigned long);
> +extern void    authtrust       (keyid_t, unsigned int);
>
> In C, ints are not guaranteed to be longer than 16 bits.
>
> http://stackoverflow.com/questions/5256000/integer-
> size-in-c-depends-on-what#5256195
>
>
See C99 "5.2.4.2.1 Sizes of integer types" for the normative definition.

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf (pg 33 of PDF)

If you have expectations of precise size of integers rather than required
minimum, you should used the stdint.h types like int32_t and uint64_t.

--joel


> Remember the poor embedded people.
>
> RGDS
> GARY
> ------------------------------------------------------------
> ---------------
> Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
>         gem at rellim.com  Tel:+1 541 382 8588
>
> _______________________________________________
> vc mailing list
> vc at ntpsec.org
> http://lists.ntpsec.org/mailman/listinfo/vc
>
> _______________________________________________
> devel mailing list
> devel at ntpsec.org
> http://lists.ntpsec.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/devel/attachments/20160923/a0440dbe/attachment.html>


More information about the devel mailing list