I’m trying to find all cases in a big project where the “get” method of a boost::shared is used — where something isn’t specific.
The problem is that some programmer was sloppy at some point and started to use bare pointers, using foo.get() to take a hold of them. So my goal is to find all places where this get method is used to review and fix the code.
I have pondered modifying the shared_ptr boost header to comment out the method and run make with the “-k” option to spot all such places, but perhaps there’s a more elegant way to do that?
I like your idea. Sounds like you are concerned about modifying a system header file, which is bad form.
Here is a slightly more elegant idea. copy the header file to /tmp/tmpinclude and then add a CFLAG -I/tmp/tmpinclude and make sure that’s the first -I CFlag. Now your hack is contained in your user/sandbox space.