diff options
author | Geoffrey Keating <geoffk@apple.com> | 2007-06-28 19:31:45 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2007-06-28 19:31:45 +0000 |
commit | ddbfd28de99524d9daf99fd7ee136286c10e72a1 (patch) | |
tree | 7c4b9efdf087040edf485f9a4ade49bcd415ba7f /gcc/doc | |
parent | b134d5eb9704caee9dee00215b03109886c8c473 (diff) | |
download | gcc-ddbfd28de99524d9daf99fd7ee136286c10e72a1.zip gcc-ddbfd28de99524d9daf99fd7ee136286c10e72a1.tar.gz gcc-ddbfd28de99524d9daf99fd7ee136286c10e72a1.tar.bz2 |
Index: gcc/ChangeLog
2007-06-21 Geoffrey Keating <geoffk@apple.com>
* doc/invoke.texi (C++ Dialect Options): Document
fvisibility-ms-compat.
* c.opt (fvisibility-ms-compat): New.
Index: gcc/cp/ChangeLog
2007-06-21 Geoffrey Keating <geoffk@apple.com>
* decl2.c (determine_visibility): Implement
flag_visibility_ms_compat effect on type info.
* decl.c (cxx_init_decl_processing): Implement
global effect of flag_visibility_ms_compat.
Index: gcc/testsuite/ChangeLog
2007-06-26 Geoffrey Keating <geoffk@apple.com>
* g++.dg/ext/visibility/ms-compat-1.C: New.
From-SVN: r126088
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index d12a627..47752e7 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -191,6 +191,7 @@ in the following sections. -frepo -fno-rtti -fstats -ftemplate-depth-@var{n} @gol -fno-threadsafe-statics -fuse-cxa-atexit -fno-weak -nostdinc++ @gol -fno-default-inline -fvisibility-inlines-hidden @gol +-fvisibility-ms-compat @gol -Wabi -Wctor-dtor-privacy @gol -Wnon-virtual-dtor -Wreorder @gol -Weffc++ -Wno-deprecated -Wstrict-null-sentinel @gol @@ -1830,6 +1831,40 @@ Explicitly instantiated inline methods are unaffected by this option as their linkage might otherwise cross a shared library boundary. @xref{Template Instantiation}. +@item -fvisibility-ms-compat +@opindex fvisibility-ms-compat +This flag attempts to use visibility settings to make GCC's C++ +linkage model compatible with that of Microsoft Visual Studio. + +The flag makes these changes to GCC's linkage model: + +@enumerate +@item +It sets the default visibility to @code{hidden}, like +@option{-fvisibility=hidden}. + +@item +Types, but not their members, are not hidden by default. + +@item +The One Definition Rule is relaxed for types without explicit +visibility specifications which are defined in more than one different +shared object: those declarations are permitted if they would have +been permitted when this option was not used. +@end enumerate + +In new code it is better to use @option{-fvisibility=hidden} and +export those classes which are intended to be externally visible. +Unfortunately it is possible for code to rely, perhaps accidentally, +on the Visual Studio behaviour. + +Among the consequences of these changes are that static data members +of the same type with the same name but defined in different shared +objects will be different, so changing one will not change the other; +and that pointers to function members defined in different shared +objects may not compare equal. When this flag is given, it is a +violation of the ODR to define types with the same name differently. + @item -fno-weak @opindex fno-weak Do not use weak symbol support, even if it is provided by the linker. |