public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* regarding type promotion
@ 2008-08-19  8:38 Sivaprasad.pv
  2008-08-19 13:24 ` Andrew Haley
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Sivaprasad.pv @ 2008-08-19  8:38 UTC (permalink / raw)
  To: gcc

Hi All,

If we consider following sample C language code :

long long int k=0x123;
int p=1;
k = k + p << 33;

Here the value in variable 'p' is shifted by 33 and then the result 
(only 32 bit result)was promoted to 64 bit.
Is it an expected behavior?
Is there any way to specify in gcc to perform implicit type promotion 
first and then perform operation on it (without explicit type casting).

Thanks,
Siva Prasad

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-08-19 23:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-19  8:38 regarding type promotion Sivaprasad.pv
2008-08-19 13:24 ` Andrew Haley
2008-08-19 15:35 ` Eljay Love-Jensen
2008-08-19 16:33 ` Bob Plantz
2008-08-19 16:34   ` Richard Harvey Chapman
2008-08-19 17:02     ` Ian Lance Taylor
2008-08-19 22:07       ` Richard Harvey Chapman
2008-08-20  2:28         ` Ian Lance Taylor
2008-08-19 22:36       ` Richard Harvey Chapman
2008-08-19 16:45   ` Richard Harvey Chapman

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).