在 2020/3/19 21:30, Martin Storsjö 写道:
> On Thu, 19 Mar 2020, Liu Hao wrote:
>
>
> (A quick grep didn't find any preexisting define with that semantic.)
>
> Right now, out of the combinations {GCC,Clang} x {C,C++}, only GCC in C
> mode warns on a line like "extern __declspec(selectany) const
> PROPERTYKEY MFPKEY_CLSID = { ... };". So if including extern only in C++
> mode, due to the differing linkage rules for const variables, this
> should avoid all warnings and avoid duplicating the list of declarations.
>
> What do you think, is that preferrable, or should we just bite the
> bullet and add explicit declarations?
> I think your solution is better, as long as it silences those warnings. As per C++03 (7.5 Linkage specifications, 7) `extern "C"` implies `extern` so it results in external linkage. -- Best regards, LH_Mouse
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
