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

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Norman Goldstein from comment #4)
> This makes sense.  Would it be a reasonable option to have the linker check
> for such mismatches?

As Andrew already said, it can only be done with LTO, and with LTO it is
already warned about. Try compiling and linking with -flto.

> The name mangling must be dropped at some point in the
> link process, for the two symbols to resolve each other at link time.

No, because the names of variables are not mangled. The name is just "foo" in
both cases.

Reply via email to