Anonymous structs collide across compilation units

NEW
Unassigned

Status

()

P3
normal
2 years ago
a year ago

People

(Reporter: sfink, Unassigned)

Tracking

(Blocks: 1 bug, {triage-deferred})

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
eg if you have

struct {
  int x;
} EXES[] = { { 3 }, { 4 } };

gcc will fabricate a type named something like "._215". If one of these contains a GC pointer, and then in a different translation unit you hold a different anonymous struct with the same name across a GC, you get a baffling false positive.

Comment 1

2 years ago
For the record, this was discovered in the attempted landing of the no-bug changesets mentioned in bug 1359980 comment 6 -- changesets which did nothing other than minimize #include dependencies, ergo reduce compile time, by adding one or two forward-declarations and #include-ing less comprehensive headers.  I landed in advance of this fix by renaming the type that served the function |EXES| serves in the example in comment 0 -- anyone else who hits this for now can act similarly as a hackaround.
Keywords: triage-deferred
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.