Opened 5 years ago
Closed 5 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() {}
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: