✘ Bad Patch: nteger handling issues (SIGN_EXTENSION).

Gary E. Miller gem at rellim.com
Thu May 11 19:19:38 UTC 2017


Yo Eric!

On Thu, 11 May 2017 14:37:53 -0400
"Eric S. Raymond" <esr at thyrsus.com> wrote:

> Do you have any good ideas about how to fix them? Please don't just
> go backward; Coverity was clearly right about the previous cast of
> the return value being broken.

get_lsb_ulong() takes an unsigned and returns and unsigned.

So it makes sense just to keep everything unsigned, but gcc thinks
this is all insigned:
	retval |= *((*bufppa)++);

But that there is an implicit conversion to int here:

       retval |= *((*bufpp)++) << 8;

Why does the "<< 8" affect the implicit sign?

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20170511/1aa9c42f/attachment.bin>


More information about the devel mailing list