http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47273
--- Comment #6 from Waldemar Valdas Bancewicz 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 possible options:
(1) Compiler inserts the fo
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47273
--- Comment #5 from Waldemar Valdas Bancewicz 2011-01-14 14:08:26 UTC ---
Created attachment 22966
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22966
testcase
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47273
--- Comment #4 from Waldemar Valdas Bancewicz 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;
int* GetValp() { return &b; }
/
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47273
--- Comment #3 from Waldemar Valdas Bancewicz 2011-01-14 13:44:04 UTC ---
This bug has to do with g++, not gcc. Should I delete this bug and re-submit?
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47273
--- Comment #2 from Waldemar Valdas Bancewicz 2011-01-14 13:42:03 UTC ---
Consider the following program test.c:
#include
struct s {
char a;
int b;
int* GetValp() { return &b; }
int& GetValr() { return b; }
} __attribute__((pack
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47273
Summary: References to unaligned packed structure members not
allowed
Product: gcc
Version: 4.4.5
Status: UNCONFIRMED
Severity: normal
Priority: P3
Compon