Reputation: 1104
There are several large C++ source files. We need to find all pointer arithmetic operations in these files. Is it possible to do this task automatically?
Is it possible to disable pointer arithmetic in some compiler and get list of errors?
Upvotes: 1
Views: 248
Reputation: 2862
Make a copy of your code and change all pointer variables to (void *). Then all pointer arithmetic will get compile errors.
Upvotes: 3
Reputation: 67345
The short answer is "no".
However, if you had software that could fully parse and understand your source code, that software would be able to determine this information. This is a major undertaking if you were to write such software yourself.
Upvotes: 0