Casey's use of renaming a type or function and recompiling to use the error reporting to see every location the type/function is used.
This one reminds me of a trick I use to rename symbols across a project by leaning on the compiler. It goes like this:
- rename a symbol (variable, parameter, type, function)
- press 'qq' in vim normal mode to start recording a macro under the letter 'q'.
- press ',,' which is my alias to compile-and-jump-to-next-error, defined like this in my .vimrc:
let mapleader = ","
nnoremap <leader>, :silent make -s -j4\|cc<CR>zv
- enter 'dw' to remove the offending symbol name
- type the new name in insertion mode
- exit insertion mode and press 'q' again to finish the macro
- enter '[email protected]
' to run the macro a hundred times, which stops as soon as the compilation succeeds
This approach also works for other rote substitutions, such as change the type of a parameter to be a pointer to its original type and turning all the incorrect '.' into '->'. However, it depends on the ability of the compiler to generate accurate row and column information for compilation errors and is easily confused if the old symbol name appears inside a C macro.