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]
Message-ID: <20190827174639.GT1131@ZenIV.linux.org.uk>
Date:   Tue, 27 Aug 2019 18:46:39 +0100
From:   Al Viro <viro@...iv.linux.org.uk>
To:     Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:     David Laight <David.Laight@...lab.com>,
        Joe Perches <joe@...ches.com>,
        Bernard Metzler <bmt@...ich.ibm.com>,
        Doug Ledford <dledford@...hat.com>,
        Jason Gunthorpe <jgg@...pe.ca>,
        linux-rdma <linux-rdma@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] RDMA/siw: Fix compiler warnings on 32-bit due to
 u64/pointer abuse

On Tue, Aug 27, 2019 at 07:29:52PM +0200, Geert Uytterhoeven wrote:
> Hi David,
> 
> On Tue, Aug 27, 2019 at 4:17 PM David Laight <David.Laight@...lab.com> wrote:
> > From: Geert Uytterhoeven
> > > Sent: 19 August 2019 18:15
> > ...
> > > > I think a cast to unsigned long is rather more common.
> > > >
> > > > uintptr_t is used ~1300 times in the kernel.
> > > > I believe a cast to unsigned long is much more common.
> > >
> > > That is true, as uintptr_t was introduced in C99.
> > > Similarly, unsigned long was used before size_t became common.
> > >
> > > However, nowadays size_t and uintptr_t are preferred.
> >
> > Isn't uintptr_t defined by the same standard as uint32_t?
> 
> I believe so.

It sure as hell is not.  C99 7.18.1.4:

The following type designates an unsigned integer type with the property that any valid
pointer to void can be converted to this type, then converted back to pointer to void,
and the result will compare equal to the original pointer:
	uintptr_t

IOW, it's "large enough to represent pointers".

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ