File tree Expand file tree Collapse file tree 5 files changed +10
-10
lines changed Expand file tree Collapse file tree 5 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -789,7 +789,7 @@ Improvements to Clang's diagnostics
789
789
}
790
790
791
791
- The :doc: `ThreadSafetyAnalysis ` now supports ``-Wthread-safety-addressof ``,
792
- which enables warning if the address of guarded variables is obtained .
792
+ which enables warning on taking the address of guarded variables.
793
793
794
794
Improvements to Clang's time-trace
795
795
----------------------------------
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ enum ProtectedOperationKind {
55
55
// / Returning a pt-guarded variable by reference.
56
56
POK_PtReturnByRef,
57
57
58
- // / Obtaining address of a variable (e.g. &x).
58
+ // / Taking address of a variable (e.g. &x).
59
59
POK_AddressOf,
60
60
};
61
61
Original file line number Diff line number Diff line change @@ -4142,10 +4142,10 @@ def note_guarded_by_declared_here : Note<"guarded_by declared here">;
4142
4142
4143
4143
// Thread safety warnings on addressof
4144
4144
def warn_addressof_requires_any_lock : Warning<
4145
- "obtaining address of variable %0 requires holding any mutex">,
4145
+ "taking address of variable %0 requires holding any mutex">,
4146
4146
InGroup<ThreadSafetyAddressof>, DefaultIgnore;
4147
4147
def warn_addressof_requires_lock : Warning<
4148
- "obtaining address of variable %1 requires holding %0 '%2'">,
4148
+ "taking address of variable %1 requires holding %0 '%2'">,
4149
4149
InGroup<ThreadSafetyAddressof>, DefaultIgnore;
4150
4150
4151
4151
// Dummy warning that will trigger "beta" warnings from the analysis if enabled.
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ int main(void) {
136
136
137
137
#ifdef CHECK_ADDRESSOF
138
138
set_value (& a_ , 0 ); // expected-warning{{calling function 'set_value' requires holding mutex 'foo_.mu_' exclusively}} \
139
- expected-warning{{obtaining address of variable 'a_' requires holding mutex 'foo_.mu_'}}
139
+ expected-warning{{taking address of variable 'a_' requires holding mutex 'foo_.mu_'}}
140
140
#else
141
141
set_value (& a_ , 0 ); // expected-warning{{calling function 'set_value' requires holding mutex 'foo_.mu_' exclusively}}
142
142
#endif
@@ -187,7 +187,7 @@ int main(void) {
187
187
late_parsing .a_value_defined_before = 1 ; // expected-warning{{writing variable 'a_value_defined_before' requires holding mutex 'a_mutex_defined_late' exclusively}}
188
188
late_parsing .a_ptr_defined_before = 0 ;
189
189
# ifdef CHECK_ADDRESSOF
190
- (void )& late_parsing .a_value_defined_before ; // expected-warning{{obtaining address of variable 'a_value_defined_before' requires holding mutex 'a_mutex_defined_late'}}
190
+ (void )& late_parsing .a_value_defined_before ; // expected-warning{{taking address of variable 'a_value_defined_before' requires holding mutex 'a_mutex_defined_late'}}
191
191
# else
192
192
(void )& late_parsing .a_value_defined_before ; // no warning
193
193
# endif
Original file line number Diff line number Diff line change @@ -4953,8 +4953,8 @@ class Foo {
4953
4953
--data_; // expected-warning {{writing variable 'data_' requires holding mutex 'mu_' exclusively}}
4954
4954
data_--; // expected-warning {{writing variable 'data_' requires holding mutex 'mu_' exclusively}}
4955
4955
#ifdef CHECK_ADDRESSOF
4956
- (void )&data_; // expected-warning {{obtaining address of variable 'data_' requires holding mutex 'mu_'}}
4957
- (void )&datap1_; // expected-warning {{obtaining address of variable 'datap1_' requires holding mutex 'mu_'}}
4956
+ (void )&data_; // expected-warning {{taking address of variable 'data_' requires holding mutex 'mu_'}}
4957
+ (void )&datap1_; // expected-warning {{taking address of variable 'datap1_' requires holding mutex 'mu_'}}
4958
4958
#else
4959
4959
(void )&data_; // no warning
4960
4960
(void )&datap1_; // no warning
@@ -5903,7 +5903,7 @@ class Foo {
5903
5903
5904
5904
void ptr_test () {
5905
5905
#ifdef CHECK_ADDRESSOF
5906
- int *b = &a; // expected-warning {{obtaining address of variable 'a' requires holding mutex 'mu'}}
5906
+ int *b = &a; // expected-warning {{taking address of variable 'a' requires holding mutex 'mu'}}
5907
5907
#else
5908
5908
int *b = &a; // no warning
5909
5909
#endif
@@ -6126,7 +6126,7 @@ class Return {
6126
6126
6127
6127
Foo *returns_ptr () {
6128
6128
#ifdef CHECK_ADDRESSOF
6129
- return &foo; // expected-warning {{obtaining address of variable 'foo' requires holding mutex 'mu'}}
6129
+ return &foo; // expected-warning {{taking address of variable 'foo' requires holding mutex 'mu'}}
6130
6130
#else
6131
6131
return &foo; // no warning
6132
6132
#endif
You can’t perform that action at this time.
0 commit comments