This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug sanitizer/80963] UBSAN false positive with visibility=hidden


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

--- Comment #5 from Jan Engelhardt <jengelh at inai dot de> ---
>Where would those magic numbers come from?  We don't have anything like that.

Maybe something similar to .build-id?, i.e. randomly-generated IDs (per .so)
that merely serve to distinguish two structs.


>>some -f option to always make UBSAN treat same-name classes as the same thing irrespective of visibility.

I think I now found that as -fvisibility-ms-compat.


>By using visibility other than default, you intentionally depart from the C++ ODR rules

I see. Then however the manpage should perhaps be updated to sport some
stronger language, since it currently rather encourages the use of visibility
and even lists the few conditions that need to be met.

"""It is strongly recommended that you use this in any shared objects you
distribute."""
"""-fvisibility does affect C++ vague linkage entities. This means that, for
instance, an exception class that is be thrown between DSOs must be explicitly
marked with default visibility so that the type_info nodes are unified between
the DSOs."""

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]