Emit warnings for symbols that were used suboptimal because of forward

definitions. For example a zero page symbol that is used as absolute because
it was undefined when encountered.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3724 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2006-04-09 10:56:23 +00:00
parent 44405a0bb5
commit c13f40a9f1
6 changed files with 151 additions and 34 deletions

View File

@@ -6,7 +6,7 @@
/* */
/* */
/* */
/* (C) 1998-2004 Ullrich von Bassewitz */
/* (C) 1998-2006 Ullrich von Bassewitz */
/* R<>merstra<72>e 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
@@ -600,6 +600,25 @@ void SymCheck (void)
}
ED_Done (&ED);
}
/* If the address size of the symbol was guessed, check the guess
* against the actual address size and print a warning if the two
* differ.
*/
if (S->AddrSize != ADDR_SIZE_DEFAULT) {
/* Do we have data for this address size? */
if (S->AddrSize <= sizeof (S->GuessedUse) / sizeof (S->GuessedUse[0])) {
/* Get the file position where the symbol was used */
const FilePos* P = S->GuessedUse[S->AddrSize - 1];
if (P) {
PWarning (P, 0,
"Didn't use %s addressing for `%s'",
AddrSizeToStr (S->AddrSize),
GetSymName (S));
}
}
}
}
/* Next symbol */