https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91222

--- Comment #13 from Jason Merrill <jason at gcc dot gnu.org> ---
Ah, I was reading the passage a bit wrong: where the extern "C" matters is not
on the type, but on the variable (ml_bssnrest_).  Because it's extern "C",
declarations in different translation units correspond even though we can't use
the same type in both.

But that still doesn't make the types the same, and the use of the variable in
2.ii has undefined behavior because it is accessing the value of the object
through the wrong type, so the warning is correct.  We may want to allow it
anyway for C compatibility.  Thoughts?

Reply via email to