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:	Fri, 25 Apr 2008 12:52:51 -0600
From:	Matthew Wilcox <matthew@....cx>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Jan Engelhardt <jengelh@...putergmbh.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Linux Arch Mailing List <linux-arch@...r.kernel.org>
Subject: Re: [PATCH 01/24] types: create <asm-generic/int-*.h>

On Fri, Apr 25, 2008 at 11:36:26AM -0700, Linus Torvalds wrote:
> On Fri, 25 Apr 2008, Jan Engelhardt wrote:
> > long long is 64 bits on both 32 and 64, is not it?
> > If so, the split between 32 and 64 should not be necessary.
> 
> They may be the same size, but there are still pure C-level _type_ 
> differences that the compiler will warn about.
> 
> This is the same issue as a 32-bit type on x86-32: is it an "int" or a 
> "long"? From a pure size perspective it shouldn't matter, but if you pass 
> a pointer to it, or use it in a "printf()", it matters a whole lot, 
> because the compiler will complain if you use the wrong version.
> 
> So on some 32-bit architectures, "size_t" is "unsigned int", on others it 
> is "unsigned long", and you have to get it right in order to avoid 
> complaints. 
> 
> The exact same thing is true about "long" vs "long long" on 64-bit 
> architectures. They may have the same size, but they don't have the same 
> type.

So ... given all this, why do we define s64 to be 'long' on some
architectures and 'long long' on others?  It seems to actively _hinder_
passing it to printf(), so there must be some other good reason that
I'm missing to not make it 'long long' everywhere.

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ