Fix error messages in sym_GetConstantValue

This commit is contained in:
ISSOtm
2020-03-11 00:03:19 +01:00
parent ea0c5581a5
commit 23effcc3f0
5 changed files with 11 additions and 5 deletions

View File

@@ -77,7 +77,7 @@ static inline bool sym_IsExported(struct sSymbol const *sym)
int32_t sym_GetValue(struct sSymbol const *sym);
uint32_t sym_CalcHash(const char *s);
void sym_SetExportAll(uint8_t set);
void sym_SetExportAll(bool set);
struct sSymbol *sym_AddLocalReloc(char const *tzSym);
struct sSymbol *sym_AddReloc(char const *tzSym);
void sym_Export(char const *tzSym);

View File

@@ -279,11 +279,11 @@ uint32_t sym_GetConstantValue(char const *s)
if (sym_IsConstant(psym))
return sym_GetValue(psym);
fatalerror("\"%s\" does not have a constant value", s);
yyerror("\"%s\" does not have a constant value", s);
} else {
yyerror("'%s' not defined", s);
}
yyerror("'%s' not defined", s);
return 0;
}
@@ -706,7 +706,7 @@ void sym_Ref(char const *tzSym)
/*
* Set whether to export all relocatable symbols by default
*/
void sym_SetExportAll(uint8_t set)
void sym_SetExportAll(bool set)
{
exportall = set;
}

View File

@@ -18,3 +18,4 @@ PRINTT "{X:S}\n"
SECTION "Test", ROM0
Label:
PRINTT "{x:Label}\n"
PRINTT "{x:@}\n"

View File

@@ -2,3 +2,6 @@ ERROR: bracketed-symbols.asm(16):
Print types are only allowed for numbers
ERROR: bracketed-symbols.asm(20):
"Label" does not have a constant value
ERROR: bracketed-symbols.asm(21):
Expected constant PC but section is not fixed
error: Assembly aborted (3 errors)!

View File

@@ -6,3 +6,5 @@ $2A
10100111001
0
You can't format me!
0
0