I am not too deeply rooted in the very formal side of static code analysis, hence this question.
A few years ago I read that distinguishing code from data using static code analysis is equivalent to "Stopping Problem . " (A quote is needed, but I don’t have it anymore. Stackoverflow has themes here or here .) At least for general computer architectures based on von Neumann architecture , where the code and data have the same memory, it seemed made sense.
Now I look at static analysis of C / C ++ code and pointer analysis; the program is not running. Somehow I get the feeling that tracking all creations and using pointer values is statically similar to the stop problem, because I can’t determine if a given value in memory is a pointer value, that is, I can’t track the value of a pointer value stream through Memory. Parsing an alias can narrow down the problem, but it seems to become less useful in front of multi-threaded code.
(You might even think about tracking arbitrary values, not just pointers: building a full stream of values for any given “interesting” value seems equivalent to a stop problem.)
Since this is just a guess, my question is: are there more formal conclusions on this subject that I can refer to? Am I mistaken?
c ++ c pointers static-analysis halting-problem
Jens
source share