I have not tried it.. but you should be able to use the "raw" tokenlist in the rule. Then your rule is executed before all the Tokenizer simplifications.
This sounds like a useful rule so feel free to add it in the Cppcheck repo.
Good luck!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to write a cppcheck rule that detects hexadecimal escape sequences in C/C++ code.
Here is an example code (test.c):
I noticed that cppcheck already converts it into its correct character interpretation ("\x41g" is equal to "Ag"):
Is there any way to write a rule that checks the input file, before it is preprocessed by cppcheck?
Many thanks
Martin
I have not tried it.. but you should be able to use the "raw" tokenlist in the rule. Then your rule is executed before all the Tokenizer simplifications.
This sounds like a useful rule so feel free to add it in the Cppcheck repo.
Good luck!