Do not descend into variables which are not global during the scan

and remove some warnings about unused rules when a preprocessor
macro name is used as variable name.