simplecpp
simplecpp copied to clipboard
wrong location for tokens
Reported in the cppcheck forum: https://sourceforge.net/p/cppcheck/discussion/general/thread/9c0ae79e38/?limit=25
Example code:
int main()
{
char* ptr = 0;
#line 16 "main.sc"
{
#line 12 "main.sc"
struct sqlexd sqlstm;
}
#line 16 "main.sc"
strcpy(ptr, "bad");
}
Cppcheck reports this:
main.sc:21:12: error: Null pointer dereference: ptr [nullPointer]
The linenumber should not be 21 it should be 16.