@@ -812,21 +812,25 @@ changes to one object won't affect the others, the object's initializer will run
812
812
once per copy, etc.
813
813
814
814
Specifically, this warning fires when it detects an object which:
815
- 1. Appears in a header file (so it might get compiled into multiple libaries), and
815
+ 1. Is defined as ``inline`` in a header file (so it might get compiled into multiple libaries), and
816
816
2. Has external linkage (otherwise it's supposed to be duplicated), and
817
817
3. Has hidden visibility.
818
818
819
819
As well as one of the following:
820
820
1. The object is mutable, or
821
821
2. The object's initializer definitely has side effects.
822
822
823
- The warning is best resolved by making the object ``const`` (if possible), or by explicitly
824
- giving the object non-hidden visibility, e.g. using ``__attribute((visibility("default")))``.
825
- Note that all levels of a pointer variable must be constant; ``const int*`` will
826
- trigger the warning because the pointer itself is mutable.
823
+ The warning can be resolved by removing one of the conditions above. In rough
824
+ order of preference, this may be done by:
825
+ 1. Marking the object ``const`` (if possible)
826
+ 2. Moving the object's definition to a source file
827
+ 3. Giving the object non-hidden visibility, e.g. using ``__attribute((visibility("default")))``.
827
828
828
- This warning is currently disabled on Windows since it uses import/export rules
829
- instead of visibility.
829
+ Note that for (2), all levels of a pointer variable must be constant;
830
+ ``const int*`` will trigger the warning because the pointer itself is mutable.
831
+
832
+ This warning is not yet implemented for Windows, since Windows uses
833
+ import/export rules instead of visibility.
830
834
}];
831
835
}
832
836
0 commit comments