Clarification required about bitfields
Konstantin Vladimirov
konstantin.vladimirov@gmail.com
Wed Dec 23 08:28:00 GMT 2015
Hi,
Now LLVM and GCC essentially disagrees on simple test (minimized from
one of dejagnu tests):
#include <stdlib.h>
struct s {
unsigned long long u33: 33;
unsigned long long u40: 40;
unsigned long long u41: 41;
};
struct s a = { 0x100000, 0x100000, 0x100000 };
int
main (void)
{
if (a.u33 * a.u33 != 0)
abort();
exit (0);
}
Compiled on GCC 5.2 passes, compiled on Clang 3.7 aborts. But when I
filed bug https://llvm.org/bugs/show_bug.cgi?id=25852 against clang on
this, it was resolved as invalid with comment that GCC behaves
incorrect here.
How do you think: who is right and should I file this bug in gcc bugzilla now?
---
With best regards, Konstantin
More information about the Gcc
mailing list