1
0
Fork 0
forked from fte/fteqw

-werror support for fteqcc

once again, blame blub.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3347 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2009-08-29 13:39:57 +00:00
parent 091c0f9288
commit 2c0a7508b0
2 changed files with 8 additions and 1 deletions

View file

@ -702,6 +702,7 @@ enum {
ERR_INVALIDSTRINGIMMEDIATE, ERR_INVALIDSTRINGIMMEDIATE,
ERR_BADCHARACTERCODE, ERR_BADCHARACTERCODE,
ERR_BADPARMS, ERR_BADPARMS,
ERR_WERROR,
WARN_MAX WARN_MAX
}; };

View file

@ -14,6 +14,7 @@ extern int optres_test1;
extern int optres_test2; extern int optres_test2;
int writeasm; int writeasm;
static pbool pr_werror;
pbool QCC_PR_SimpleGetToken (void); pbool QCC_PR_SimpleGetToken (void);
@ -2467,6 +2468,8 @@ void QCC_PR_CommandLinePrecompilerOptions (void)
memset(qccwarningdisabled, 0, sizeof(qccwarningdisabled)); memset(qccwarningdisabled, 0, sizeof(qccwarningdisabled));
else if (!stricmp(myargv[i]+2, "none")) else if (!stricmp(myargv[i]+2, "none"))
memset(qccwarningdisabled, 1, sizeof(qccwarningdisabled)); memset(qccwarningdisabled, 1, sizeof(qccwarningdisabled));
else if(!stricmp(myargv[i]+2, "error"))
pr_werror = true;
else if (!stricmp(myargv[i]+2, "no-mundane")) else if (!stricmp(myargv[i]+2, "no-mundane"))
{ //disable mundane performance/efficiency/blah warnings that don't affect code. { //disable mundane performance/efficiency/blah warnings that don't affect code.
qccwarningdisabled[WARN_SAMENAMEASGLOBAL] = true; qccwarningdisabled[WARN_SAMENAMEASGLOBAL] = true;
@ -2800,6 +2803,7 @@ void QCC_main (int argc, char **argv) //as part of the quake engine
{ {
*compiler_flag[p].enabled = compiler_flag[p].flags & FLAG_ASDEFAULT; *compiler_flag[p].enabled = compiler_flag[p].flags & FLAG_ASDEFAULT;
} }
pr_werror = false;
QCC_SetDefaultProperties(); QCC_SetDefaultProperties();
@ -3194,7 +3198,9 @@ void QCC_FinishCompile(void)
} }
}*/ }*/
if (pr_werror && pr_werror)
QCC_Error (ERR_PARSEERRORS, "compilation errors");
// write progdefs.h // write progdefs.h
crc = QCC_PR_WriteProgdefs ("progdefs.h"); crc = QCC_PR_WriteProgdefs ("progdefs.h");