public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: A
@ 2006-07-31 15:36 Timothy C Prince
  0 siblings, 0 replies; only message in thread
From: Timothy C Prince @ 2006-07-31 15:36 UTC (permalink / raw)
  To: wg_nwpu; +Cc: gcc-help



-----Original Message-----
From: bacmoz <wg_nwpu@yahoo.com.cn>
	a = 1<<(8 * sizeof(unsigned long long) - 1);			//	here give a warning
i don't know why i cannot get 1<<63 in my c program.

if change the type "unsigned long long" to "unsigned int", the result is ok.
_________________________________________________--
Perhaps you mean to use a constant of some type other than int, such as 1LL.  The result of shifting an int (32 bits on your platform) by 63 bits is hardware dependent, so gcc warns you.  I know you meant the code to be platform dependent (e.g. by assuming 8 bits per byte), but gcc wants to help you anyway.

Tim Prince

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-07-31 15:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-31 15:36 A Timothy C Prince

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).