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: <alpine.LFD.1.10.0805021407030.5994@woody.linux-foundation.org>
Date:	Fri, 2 May 2008 14:14:25 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	"H. Peter Anvin" <hpa@...or.com>
cc:	"Carlos R. Mafra" <crmafra@....unesp.br>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] kernel/time.c: Silence gcc warning 'integer constant to
 large for long type'



On Fri, 2 May 2008, H. Peter Anvin wrote:
> 
> kernel/time.c: In function msecs_to_jiffies:
> kernel/time.c:479: warning: integer constant is too large for long type

Shouldn't we fix the perl-script to mark the constants appropriately 
typed? Ie add the proper "ul" or "ull" endings there as necessary?

For example, I see

	#define MSEC_TO_HZ_ADJ64        0x18000000000000000

in the auto-generated timeconst.h file, and the fact is, that's a really 
really ugly constant. It simply doesn't even fit in a u64. Why do these 
kinds of pointless and useless #define even get generated, when using them 
would inevitably be a bug anyway?

As to the ones that *do* fit in 64 bits, they should still haev the 
correct "ul" and "ull" endings on 64- and 32-bit architectures 
respectively. Yeah, hex constants are always unsigned and the compiler 
will expand them to the right size, but the compiler is also rigth to warn 
about it (and casting them shouldn't even change that fact, even if it 
happens to do so with gcc).

		Linus
--
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