mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Remove local label error checking
This is actually not necessary, because RGBLINK would warn about missing labels. Besides, through semi-esoteric ways, it is possible to define more labels in this scope, and there's no reason to prevent that.
This commit is contained in:
@@ -40,7 +40,6 @@ void out_AbsByteGroup(char *s, int32_t length);
|
||||
void out_RelByte(struct Expression *expr);
|
||||
void out_RelWord(struct Expression *expr);
|
||||
void out_PCRelByte(struct Expression *expr);
|
||||
void out_CheckErrors(void);
|
||||
void out_WriteObject(void);
|
||||
void out_Skip(int32_t skip);
|
||||
void out_BinaryFile(char *s);
|
||||
|
||||
@@ -471,7 +471,6 @@ int main(int argc, char *argv[])
|
||||
(int)(60 / timespent * nTotalLines));
|
||||
}
|
||||
|
||||
out_CheckErrors();
|
||||
/* If no path specified, don't write file */
|
||||
if (tzObjectname != NULL)
|
||||
out_WriteObject();
|
||||
|
||||
@@ -526,34 +526,6 @@ static void checksectionoverflow(uint32_t delta_size)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for errors that could happen while writing an object file
|
||||
* This is important as out_WriteObject is skipped entirely when `-o` is omitted
|
||||
* Therefore, errors such as memory allocations still should be handled in
|
||||
* out_WriteObject and not here
|
||||
*/
|
||||
void out_CheckErrors(void)
|
||||
{
|
||||
/* Local symbols cannot be imported from elsewhere */
|
||||
struct PatchSymbol *pSym = pPatchSymbols;
|
||||
|
||||
while (pSym) {
|
||||
struct sSymbol const *pSymbol = pSym->pSymbol;
|
||||
|
||||
if (!(pSymbol->nType & SYMF_DEFINED)
|
||||
&& pSymbol->nType & SYMF_LOCAL) {
|
||||
char const *name = pSymbol->tzName;
|
||||
char const *localPtr = strchr(name, '.');
|
||||
|
||||
if (localPtr)
|
||||
name = localPtr;
|
||||
errx(1, "%s(%u) : '%s' not defined",
|
||||
pSymbol->tzFileName, pSymbol->nFileLine, name);
|
||||
}
|
||||
pSym = pSym->pNext;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Write an objectfile
|
||||
*/
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
error: undefined-dot.asm(3) : '.' not defined
|
||||
|
||||
Reference in New Issue
Block a user