[Bug c/47273] References to unaligned packed structure members not allowed

2011-01-14 Thread waldemarbancewicz at ruggedcom dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47273 --- Comment #2 from Waldemar Valdas Bancewicz waldemarbancewicz at ruggedcom dot com 2011-01-14 13:42:03 UTC --- Consider the following program test.c: #include stdio.h struct s { char a; int b; int* GetValp() { return b; } int

[Bug c/47273] References to unaligned packed structure members not allowed

2011-01-14 Thread waldemarbancewicz at ruggedcom dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47273 --- Comment #3 from Waldemar Valdas Bancewicz waldemarbancewicz at ruggedcom dot com 2011-01-14 13:44:04 UTC --- This bug has to do with g++, not gcc. Should I delete this bug and re-submit?

[Bug c/47273] References to unaligned packed structure members not allowed

2011-01-14 Thread waldemarbancewicz at ruggedcom dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47273 --- Comment #4 from Waldemar Valdas Bancewicz waldemarbancewicz at ruggedcom dot com 2011-01-14 14:04:19 UTC --- The reason pointers and references are treated differently: Consider the following code fragment: struct s { char a; int b;

[Bug c/47273] References to unaligned packed structure members not allowed

2011-01-14 Thread waldemarbancewicz at ruggedcom dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47273 --- Comment #5 from Waldemar Valdas Bancewicz waldemarbancewicz at ruggedcom dot com 2011-01-14 14:08:26 UTC --- Created attachment 22966 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=22966 testcase

[Bug c/47273] References to unaligned packed structure members not allowed

2011-01-14 Thread waldemarbancewicz at ruggedcom dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47273 --- Comment #6 from Waldemar Valdas Bancewicz waldemarbancewicz at ruggedcom dot com 2011-01-14 15:42:57 UTC --- About Comment #4: This is a question to the GCC/G++ team. How are unaligned pointers dealt with? I came up with the following

[Bug c++/47273] References to unaligned packed structure members not allowed

2011-01-14 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47273 Richard Guenther rguenth at gcc dot gnu.org changed: What|Removed |Added Status|WAITING |NEW

[Bug c++/47273] References to unaligned packed structure members not allowed

2011-01-14 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47273 --- Comment #8 from Richard Guenther rguenth at gcc dot gnu.org 2011-01-14 16:02:06 UTC --- It works with typedef int T __attribute__((aligned(1))); struct s { T a; T GetValr() { return a; } } __attribute__((packed)); int main() {

[Bug c++/47273] References to unaligned packed structure members not allowed

2011-01-14 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47273 Andrew Pinski pinskia at gcc dot gnu.org changed: What|Removed |Added Status|NEW |RESOLVED

[Bug c/47273] References to unaligned packed structure members not allowed

2011-01-13 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47273 Richard Guenther rguenth at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |WAITING