This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/41793] [4.3/4.4/4.5 Regression] About Long long bit field
- From: "shenrfen at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Oct 2009 09:42:05 -0000
- Subject: [Bug c/41793] [4.3/4.4/4.5 Regression] About Long long bit field
- References: <bug-41793-17793@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from shenrfen at gmail dot com 2009-10-22 09:42 -------
Confused for the result.
int main()
{
struct s t = {1, 2, 3};
printf("0x%llx\n",(t.a-8));
printf("0x%llx\n",(t.b-8));
printf("0x%llx\n",(t.c-8));
}
the output is as following
0xfffffff9 (32 bit)
0xfffffffffa (40 bit)
0xfffffffffb (40 bit)
if one operand type is long long bit filed and another is 32-bit int, What is
the type conversion rule? Or it is an undefined behavior?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41793