* [Bug c/53760] attribute packed doesn't pack inner structs
2012-06-24 14:19 [Bug c/53760] New: attribute packed doesn't pack inner structs stsp at users dot sourceforge.net
@ 2012-06-24 17:59 ` pinskia at gcc dot gnu.org
2012-06-24 18:09 ` stsp at users dot sourceforge.net
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-06-24 17:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53760
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-06-24 17:59:08 UTC ---
I think having a size of 4 is correct. Packed is on a byte boundary and not a
bit boundary.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/53760] attribute packed doesn't pack inner structs
2012-06-24 14:19 [Bug c/53760] New: attribute packed doesn't pack inner structs stsp at users dot sourceforge.net
2012-06-24 17:59 ` [Bug c/53760] " pinskia at gcc dot gnu.org
@ 2012-06-24 18:09 ` stsp at users dot sourceforge.net
2012-06-24 18:13 ` pinskia at gcc dot gnu.org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: stsp at users dot sourceforge.net @ 2012-06-24 18:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53760
--- Comment #2 from Stas Sergeev <stsp at users dot sourceforge.net> 2012-06-24 18:09:18 UTC ---
Even if "attribute packed" have nothing to do with this,
then why doesn't it pack regardless?
Eg,
struct {
char a:1;
char b:1;
char c:1;
}
would be packed, no matter what.
Why does the same not happen to the struct?
Any way to force such a packing? There is an
obvious (IMHO) need for that.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/53760] attribute packed doesn't pack inner structs
2012-06-24 14:19 [Bug c/53760] New: attribute packed doesn't pack inner structs stsp at users dot sourceforge.net
2012-06-24 17:59 ` [Bug c/53760] " pinskia at gcc dot gnu.org
2012-06-24 18:09 ` stsp at users dot sourceforge.net
@ 2012-06-24 18:13 ` pinskia at gcc dot gnu.org
2012-06-24 18:20 ` stsp at users dot sourceforge.net
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-06-24 18:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53760
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-06-24 18:12:39 UTC ---
Because each inner struct has to be at a byte boundary.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/53760] attribute packed doesn't pack inner structs
2012-06-24 14:19 [Bug c/53760] New: attribute packed doesn't pack inner structs stsp at users dot sourceforge.net
` (2 preceding siblings ...)
2012-06-24 18:13 ` pinskia at gcc dot gnu.org
@ 2012-06-24 18:20 ` stsp at users dot sourceforge.net
2012-06-25 6:52 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: stsp at users dot sourceforge.net @ 2012-06-24 18:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53760
--- Comment #4 from Stas Sergeev <stsp at users dot sourceforge.net> 2012-06-24 18:20:00 UTC ---
Is this mandated in some spec or doc?
Any way to defeat that? :)
Btw, why can't the "attribute packed" be
allowed to pack on a bit boundary too?
Sounds like a useless limitation, no?
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/53760] attribute packed doesn't pack inner structs
2012-06-24 14:19 [Bug c/53760] New: attribute packed doesn't pack inner structs stsp at users dot sourceforge.net
` (3 preceding siblings ...)
2012-06-24 18:20 ` stsp at users dot sourceforge.net
@ 2012-06-25 6:52 ` jakub at gcc dot gnu.org
2012-06-25 8:12 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-06-25 6:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53760
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-06-25 06:51:12 UTC ---
It is not a useless limitation. While you can't take address of a bitfield,
you can take address of a struct field, even when it contains only bitfields.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/53760] attribute packed doesn't pack inner structs
2012-06-24 14:19 [Bug c/53760] New: attribute packed doesn't pack inner structs stsp at users dot sourceforge.net
` (4 preceding siblings ...)
2012-06-25 6:52 ` jakub at gcc dot gnu.org
@ 2012-06-25 8:12 ` rguenth at gcc dot gnu.org
2012-06-25 10:07 ` ebotcazou at gcc dot gnu.org
2012-06-25 10:30 ` stsp at users dot sourceforge.net
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-25 8:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53760
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-25 08:11:17 UTC ---
Indeed.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/53760] attribute packed doesn't pack inner structs
2012-06-24 14:19 [Bug c/53760] New: attribute packed doesn't pack inner structs stsp at users dot sourceforge.net
` (5 preceding siblings ...)
2012-06-25 8:12 ` rguenth at gcc dot gnu.org
@ 2012-06-25 10:07 ` ebotcazou at gcc dot gnu.org
2012-06-25 10:30 ` stsp at users dot sourceforge.net
7 siblings, 0 replies; 9+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2012-06-25 10:07 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53760
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ebotcazou at gcc dot
| |gnu.org
--- Comment #7 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2012-06-25 10:06:23 UTC ---
> Is this mandated in some spec or doc?
> Any way to defeat that? :)
If you're ready to switch language. The Ada language supports bit-packedness.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/53760] attribute packed doesn't pack inner structs
2012-06-24 14:19 [Bug c/53760] New: attribute packed doesn't pack inner structs stsp at users dot sourceforge.net
` (6 preceding siblings ...)
2012-06-25 10:07 ` ebotcazou at gcc dot gnu.org
@ 2012-06-25 10:30 ` stsp at users dot sourceforge.net
7 siblings, 0 replies; 9+ messages in thread
From: stsp at users dot sourceforge.net @ 2012-06-25 10:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53760
--- Comment #8 from Stas Sergeev <stsp at users dot sourceforge.net> 2012-06-25 10:29:40 UTC ---
I think gcc C could support it too by
some "pack_harder" attribute (and then not
allow pointers to such structs), but I've got
the point. :)
^ permalink raw reply [flat|nested] 9+ messages in thread