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