This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/7362: "Pack" attribute causes compiler error on empty structs
- From: gonz at bluel dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 20 Jul 2002 10:33:16 -0000
- Subject: c++/7362: "Pack" attribute causes compiler error on empty structs
- Reply-to: gonz at bluel dot com
>Number: 7362
>Category: c++
>Synopsis: "Pack" attribute causes compiler error on empty structs
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Sat Jul 20 11:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Pete Gonzalez <gonz@bluel.com>
>Release: gcc version 2.95.2
>Organization:
>Environment:
Occurs on the GCC shipping with the current distribution of Debian Linux. Originally discovered with GCC 3.0.4 on Win32.
>Description:
The "__attribute__((packed))" modifier cannot be applied to an empty struct because it produces an Internal Compiler Error.
>How-To-Repeat:
int test() {
__attribute__((packed))
struct TEmpty { }; // <-- crash here
}
>Fix:
The correct behavior is probably to reduce the size of the struct from 4 to 1.
>Release-Note:
>Audit-Trail:
>Unformatted: