<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 23, 2016 at 2:09 PM, Kurt Roeckx <span dir="ltr"><<a href="mailto:kurt@roeckx.be" target="_blank">kurt@roeckx.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Sep 23, 2016 at 01:41:07PM -0500, Joel Sherrill wrote:<br>
> On Fri, Sep 23, 2016 at 1:08 PM, Gary E. Miller <<a href="mailto:gem@rellim.com">gem@rellim.com</a>> wrote:<br>
><br>
> > Yo Eric!<br>
> ><br>
> ><br>
> > > These are valid because the invention and major uses of u_long in this<br>
> > > codebase predate the 64-bit transition - it may look like we're<br>
> > > narrowing size from 64 to 32 bits, but what we're actually doing is<br>
> > > replacing an earlier hack for guaranteeing 32-bit size by people<br>
> > > who cut their teeth on 16-bit ints.<br>
> ><br>
> > I disagree with this patch.<br>
> ><br>
> > -extern void authtrust (keyid_t, unsigned long);<br>
> > +extern void authtrust (keyid_t, unsigned int);<br>
> ><br>
> > In C, ints are not guaranteed to be longer than 16 bits.<br>
> ><br>
> > <a href="http://stackoverflow.com/questions/5256000/integer-" rel="noreferrer" target="_blank">http://stackoverflow.com/<wbr>questions/5256000/integer-</a><br>
> > size-in-c-depends-on-what#<wbr>5256195<br>
> ><br>
> ><br>
> See C99 "5.2.4.2.1 Sizes of integer types" for the normative definition.<br>
><br>
> <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf" rel="noreferrer" target="_blank">http://www.open-std.org/jtc1/<wbr>sc22/wg14/www/docs/n1256.pdf</a> (pg 33 of PDF)<br>
><br>
> If you have expectations of precise size of integers rather than required<br>
> minimum, you should used the stdint.h types like int32_t and uint64_t.<br>
<br>
</span>Exactly. And if it's just a minimum you could use int_least32_t.<br>
<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div>Agreed. It makes the expectations of the author on the variable's size</div><div>and expected range much more explicit.</div><div><br></div><div>-joel </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
<br>
Kurt<br>
<br>
</font></span></blockquote></div><br></div></div>