https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84046
Bug ID: 84046
Summary: global zero-sized objects may have same address
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: uecker at eecs dot berkeley.edu
Target Milestone: ---
Created attachment 43246
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43246&action=edit
test case
With newer versions of gcc (tested: 6.3.0 and recent git) global zero-sized
objects may have the same address. The only real use of such objects at a
global level is to create unique addresses, but this newer behavior breaks this
use case. Older versions of gcc (tested: 4.8 and 4.9) seem to always assign
different addresses and the same is true for clang 3.8 and 3.9.