Fix for erroneous warning messages when definining compiler constants.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1498 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
9ca5cce92a
commit
27044fbbcb
1 changed files with 8 additions and 4 deletions
|
@ -1901,10 +1901,14 @@ void QCC_PR_ConditionCompilation(void)
|
|||
if (strlen(cnst->value) >= sizeof(cnst->value)) //this is too late.
|
||||
QCC_PR_ParseError(ERR_CONSTANTTOOLONG, "Macro %s too long (%i not %i)", cnst->name, strlen(cnst->value), sizeof(cnst->value));
|
||||
|
||||
if (oldval && strcmp(oldval, cnst->value))
|
||||
QCC_PR_ParseWarning(WARN_DUPLICATEPRECOMPILER, "Alternate precompiler definition of %s", pr_token);
|
||||
else
|
||||
QCC_PR_ParseWarning(WARN_IDENTICALPRECOMPILER, "Identical precompiler definition of %s", pr_token);
|
||||
if (oldval)
|
||||
{ //we always warn if it was already defined
|
||||
//we use different warning codes so that -Wno-mundane can be used to ignore identical redefinitions.
|
||||
if (strcmp(oldval, cnst->value))
|
||||
QCC_PR_ParseWarning(WARN_DUPLICATEPRECOMPILER, "Alternate precompiler definition of %s", pr_token);
|
||||
else
|
||||
QCC_PR_ParseWarning(WARN_IDENTICALPRECOMPILER, "Identical precompiler definition of %s", pr_token);
|
||||
}
|
||||
}
|
||||
|
||||
int QCC_PR_CheakCompConst(void)
|
||||
|
|
Loading…
Reference in a new issue