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
789789 }
790790
791791- 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.
793793
794794Improvements to Clang's time-trace
795795----------------------------------
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ enum ProtectedOperationKind {
5555 // / Returning a pt-guarded variable by reference.
5656 POK_PtReturnByRef,
5757
58- // / Obtaining address of a variable (e.g. &x).
58+ // / Taking address of a variable (e.g. &x).
5959 POK_AddressOf,
6060};
6161
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">;
41424142
41434143// Thread safety warnings on addressof
41444144def 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">,
41464146 InGroup<ThreadSafetyAddressof>, DefaultIgnore;
41474147def 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'">,
41494149 InGroup<ThreadSafetyAddressof>, DefaultIgnore;
41504150
41514151// 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) {
136136
137137#ifdef CHECK_ADDRESSOF
138138 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_'}}
140140#else
141141 set_value (& a_ , 0 ); // expected-warning{{calling function 'set_value' requires holding mutex 'foo_.mu_' exclusively}}
142142#endif
@@ -187,7 +187,7 @@ int main(void) {
187187 late_parsing .a_value_defined_before = 1 ; // expected-warning{{writing variable 'a_value_defined_before' requires holding mutex 'a_mutex_defined_late' exclusively}}
188188 late_parsing .a_ptr_defined_before = 0 ;
189189# 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'}}
191191# else
192192 (void )& late_parsing .a_value_defined_before ; // no warning
193193# endif
Original file line number Diff line number Diff line change @@ -4953,8 +4953,8 @@ class Foo {
49534953 --data_; // expected-warning {{writing variable 'data_' requires holding mutex 'mu_' exclusively}}
49544954 data_--; // expected-warning {{writing variable 'data_' requires holding mutex 'mu_' exclusively}}
49554955#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_'}}
49584958#else
49594959 (void )&data_; // no warning
49604960 (void )&datap1_; // no warning
@@ -5903,7 +5903,7 @@ class Foo {
59035903
59045904 void ptr_test () {
59055905#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'}}
59075907#else
59085908 int *b = &a; // no warning
59095909#endif
@@ -6126,7 +6126,7 @@ class Return {
61266126
61276127 Foo *returns_ptr () {
61286128#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'}}
61306130#else
61316131 return &foo; // no warning
61326132#endif
You can’t perform that action at this time.
0 commit comments