Changed all error messages to print to stderr

This commit is contained in:
Curtis F Kaylor 2018-02-08 23:21:46 -05:00
parent 45d66353d0
commit 470e89210e
6 changed files with 15 additions and 16 deletions

View File

@ -22,7 +22,7 @@ void exterr(int errnum)
Args: expected - Description of what was expected */
void expctd(char *expstr)
{
printf("Expected %s, but found '%c'\n", expstr, nxtchr);
fprintf(stderr, "Expected %s, but found '%c'\n", expstr, nxtchr);
exterr(EXIT_FAILURE);
}

2
cond.c
View File

@ -80,7 +80,7 @@ void prccmp()
asmlin("BNE", cndlbl);
break;
default:
printf("Unsupported comparison operator index %d\n", cmprtr);
fprintf(stderr, "Unsupported comparison operator index %d\n", cmprtr);
exterr(EXIT_FAILURE);
}
}

2
expr.c
View File

@ -223,7 +223,7 @@ void prcopr()
asmlin("EOR", term);
break;
default:
printf("Unrecognized operator '%c'\n", oper);
fprintf(stderr, "Unrecognized operator '%c'\n", oper);
exterr(EXIT_FAILURE);
}
oper = 0;

View File

@ -76,7 +76,7 @@ void pascii()
invasc = TRUE;
}
else {
printf("Unrecognized option '%s'\n", word);
fprintf(stderr, "Unrecognized option '%s'\n", word);
exterr(EXIT_FAILURE);
}
@ -134,7 +134,7 @@ void pincdr()
if (wordis("PRAGMA"))
pprgma();
else {
printf("Unrecognized directive '%s'\n", word);
fprintf(stderr, "Unrecognized directive '%s'\n", word);
exterr(EXIT_FAILURE);
}
}
@ -143,7 +143,7 @@ void pincdr()
void phdwrd() {
getwrd();
if (!ptype(MTNONE)) {
printf("Unexpected word '%s' in header\n", word);
fprintf(stderr, "Unexpected word '%s' in header\n", word);
exterr(EXIT_FAILURE);
}
}
@ -192,11 +192,10 @@ void inchdr() {
skpcmt();
else if (isalph())
phdwrd();
else
{
printf("Unexpected character '%c'\n", nxtchr);
exterr(EXIT_FAILURE);
}
else {
fprintf(stderr, "Unexpected character '%c'\n", nxtchr);
exterr(EXIT_FAILURE);
}
}
clsinc();
rstsrc();
@ -214,7 +213,7 @@ void pincfl()
DEBUG("Processing include file '%s'\n", incnam);
char *dot = strrchr(incnam, '.'); //find extension
if (dot == NULL) {
printf("Invalid include file name '%sn", incnam);
fprintf(stderr, "Invalid include file name '%sn", incnam);
exterr(EXIT_FAILURE);
}
if (strcmp(dot, ".a02") == 0)
@ -229,7 +228,7 @@ void pincfl()
incasm(); //Process Assembly File with Same Name
}
else {
printf("Unrecognized include file extension '%s'\n'", dot);
fprintf(stderr, "Unrecognized include file extension '%s'\n'", dot);
exterr(EXIT_FAILURE);
}
}

View File

@ -92,7 +92,7 @@ void expect(char c)
if (c == 0) return;
if (look(c)) return;
else {
printf("Expected Character '%c', but found '%c'\n", c, nxtchr);
fprintf(stderr, "Expected Character '%c', but found '%c'\n", c, nxtchr);
exterr(EXIT_FAILURE);
}
}
@ -448,7 +448,7 @@ void prcpst(char* name, char *index)
asmlin("LSR", name);
break;
default:
printf("Unrecognized post operator '%c'\n", oper);
fprintf(stderr, "Unrecognized post operator '%c'\n", oper);
exterr(EXIT_FAILURE);
}
}

View File

@ -60,7 +60,7 @@ void prcasn(char trmntr)
void poperr()
{
printf("Illegal post-operation %c%c on register %s\n", oper, oper, asnvar);
fprintf(stderr, "Illegal post-operation %c%c on register %s\n", oper, oper, asnvar);
exterr(EXIT_FAILURE);
}