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:   Thu, 11 Nov 2021 09:26:31 +0100
From:   Anders Roxell <anders.roxell@...aro.org>
To:     Nick Desaulniers <ndesaulniers@...gle.com>
Cc:     shuah@...nel.org, nathan@...nel.org,
        linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
        llvm@...ts.linux.dev, Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCHv2] selftests: timens: exec: use 'labs()' over 'abs()'

On Wed, 10 Nov 2021 at 21:11, Nick Desaulniers <ndesaulniers@...gle.com> wrote:
>
> On Wed, Nov 10, 2021 at 12:09 PM Nick Desaulniers
> <ndesaulniers@...gle.com> wrote:
> >
> > On Wed, Nov 10, 2021 at 10:04 AM Anders Roxell <anders.roxell@...aro.org> wrote:
> > >
> > > When building selftests/timens with clang, the compiler warn about the
> > > function abs() see below:
> > >
> > > exec.c:33:8: error: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
> > >                         if (abs(tst.tv_sec - now.tv_sec) > 5)
> > >                             ^
> > > exec.c:33:8: note: use function 'labs' instead
> > >                         if (abs(tst.tv_sec - now.tv_sec) > 5)
> > >                             ^~~
> > >                             labs
> > >
> > > Rework to store the time difference in a 'long long' and pass that to
> > > llabs(), since the variable can be an 'int', 'long' or 'long long'
> > > depending on the architecture and C library.
> > >
> > > Suggested-by: Arnd Bergmann <arnd@...db.de>
> > > Signed-off-by: Anders Roxell <anders.roxell@...aro.org>
> >
> > Thanks for the patch!
> > Reviewed-by: Nick Desaulniers <ndesaulniers@...gle.com>
>
> ah, gmail doesn't do a great job at showing the subject when a v2 is
> sent in-reply-to.

oh right, sorry.

>  Should the oneline mention llabs rather than labs
> now?

You are correct, can this be changed when the patch gets applied or
should I send a v3?

Cheers,
Anders

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ