MantisBT - CMake
View Issue Details
0014187CMake(No Category)public2013-06-02 18:182013-11-04 09:33
Yichao Yu 
Brad King 
normalminorhave not tried
closedfixed 
linuxarch linux
CMake 2.8.11 
CMake 2.8.12CMake 2.8.12 
0014187: variable_watch with no command name will cause READ_ACCESS for all variables in the current scope.
When a variable that is being watched by variable_watch with no command name is accessed, not only a message is printed out but all other variables in the current scope will feel an READ_ACCESS and therefore execute watch commands on them.
function(my_func)
  message("my_func")
endfunction()
variable_watch(a my_func)
set(a "")

variable_watch(b)
set(b "")

expected output:

my_func
* Variable "b" was accessed using REMOVED_ACCESS in: ....
  The value of the variable: ""
  The list file stack: ...

actual output:

my_func
* Variable "b" was accessed using REMOVED_ACCESS in: ....
  The value of the variable: ""
  The list file stack: ...
my_func
No tags attached.
related to 0014188closed Brad King variable_watch print REMOVED_ACCESS instead of MODIFIED_ACCESS when set the value of the variable. 
Issue History
2013-06-02 18:18Yichao YuNew Issue
2013-06-02 18:22Yichao YuNote Added: 0033170
2013-06-03 11:07Brad KingNote Added: 0033210
2013-06-03 11:07Brad KingStatusnew => backlog
2013-06-03 13:06Brad KingAssigned To => Brad King
2013-06-03 13:06Brad KingStatusbacklog => assigned
2013-06-03 13:06Brad KingTarget Version => CMake 2.8.12
2013-06-03 13:25Brad KingNote Added: 0033216
2013-06-03 13:25Brad KingStatusassigned => resolved
2013-06-03 13:25Brad KingResolutionopen => fixed
2013-06-03 13:25Brad KingFixed in Version => CMake 2.8.12
2013-06-03 13:26Brad KingRelationship addedrelated to 0014188
2013-11-04 09:33Robert MaynardNote Added: 0034357
2013-11-04 09:33Robert MaynardStatusresolved => closed

Notes
(0033170)
Yichao Yu   
2013-06-02 18:22   
... forgot to select, I can always reproduce this.
(0033210)
Brad King   
2013-06-03 11:07   
It looks like this was introduced when the feature was first added:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f9f1ccad#patch6 [^]

The logic at line 117:

 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmVariableWatchCommand.cxx;hb=v2.8.11#l117 [^]

prints out all definitions when no command processes the watch. It looks like leftover debugging code to me.
(0033216)
Brad King   
2013-06-03 13:25   
Fixed:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=515f9af0 [^]

While at it, I improved the access message format to include a better call stack:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=647745b3 [^]
(0034357)
Robert Maynard   
2013-11-04 09:33   
Closing resolved issues that have not been updated in more than 4 months.