treating #error as if it was #warning in to

added test https://github.com/radare/radare2-regressions/pull/335
the bug can be re generated by parsing header with a #error in there
the compile in the normal case will issue an error and terminate
but since no compilation is done we need to proceed parsign the file
and treating the errors as warning just to be able to get all the types
in the given file.
This commit is contained in:
oddcoder 2016-03-16 00:45:45 +02:00 committed by pancake
parent 0ec1b47b7c
commit 19992a16c1

View File

@ -1633,10 +1633,7 @@ include_done:
inp();
}
*q = '\0';
if (c == TOK_ERROR)
tcc_error("#error %s", buf);
else
tcc_warning("#warning %s", buf);
tcc_warning("#%s %s",c==TOK_ERROR?"error":"warning",buf);
break;
case TOK_PRAGMA:
pragma_parse(s1);