Removed the extra "unused parameter" warning when the parameter had an duplicated identifier error.

This commit is contained in:
acqn 2024-01-14 00:19:11 +08:00
parent 7e80e55b6d
commit de3087a7e9
1 changed files with 2 additions and 1 deletions

View File

@ -170,7 +170,8 @@ static void CheckSymTable (SymTable* Tab)
if (SymIsDef (Entry) && !SymIsRef (Entry) &&
!SymHasAttr (Entry, atUnused)) {
if (Flags & SC_PARAM) {
if (IS_Get (&WarnUnusedParam)) {
if (IS_Get (&WarnUnusedParam) &&
!IsAnonName (Entry->Name)) {
Warning ("Parameter '%s' is never used", Entry->Name);
}
} else if ((Flags & SC_TYPEMASK) == SC_FUNC) {