Opened 4 years ago
Closed 4 years ago
#182 closed defect (fixed)
Static Const Global variable segfault in generated code
Reported by: | Thierry Delisle | Owned by: | |
---|---|---|---|
Priority: | major | Component: | cfa-cc |
Version: | 1.0 | Keywords: | global |
Cc: |
Description
The following code segfaults when run:
static const char foo = -1; int main() {}
Change History (2)
comment:1 Changed 4 years ago by
comment:2 Changed 4 years ago by
Owner: | set to Michael Brooks <mlbrooks@…> |
---|---|
Resolution: | → fixed |
Status: | new → closed |
In 6fbe9a5:
Note: See
TracTickets for help on using
tickets.
A tough experience reproducing has these lessons.
The "static" on the constant is required (regardless of gcc versions, as discussed below).
The problem seems to happen with gcc-8 and not with gcc-6.
Specifically these configurations on plg2 show the difference.
Gets the segfault:
Does not get the segfault: