lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 27 Nov 2019 08:44:46 -0800
From:   Maciej Żenczykowski <maze@...gle.com>
To:     Stephen Hemminger <stephen@...workplumber.org>
Cc:     Brian Vazquez <brianvv@...gle.com>,
        Brian Vazquez <brianvv.kernel@...il.com>,
        David Ahern <dsahern@...il.com>,
        Mahesh Bandewar <maheshb@...gle.com>,
        Linux NetDev <netdev@...r.kernel.org>,
        Leslie Monis <lesliemonis@...il.com>
Subject: Re: [PATCH iproute2] tc: fix warning in q_pie.c

> What compiler is this?
> The type seems correct already.  The type of double / unsigned long is double.
> And the conversion may give different answer.

Probably some recent version of clang with -Wall.

That said, I think the warning/error is correct.
UINT64 doesn't fit in double (which is also 64 bits, but includes sign
and exponent) - you lose ~13 bits of precision.
I'm not aware of a way to (natively) divide a double by a uint64
without the loss (not that it really matters since the double doesn't
have the requisite precision in the first place).

Why do you think the conversion will give a different answer?
Isn't this exactly what the compiler will do anyway?
It's not like we have long double anymore...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ