mirror of
https://github.com/cc65/cc65.git
synced 2025-01-11 11:30:13 +00:00
Limit the number of additional line infos printed in case of an error or
warning. git-svn-id: svn://svn.cc65.org/cc65/trunk@5037 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
7db7f34d91
commit
f8089b98c1
@ -120,13 +120,20 @@ static void PrintMsg (const FilePos* Pos, const char* Desc,
|
|||||||
static void AddNotifications (const Collection* LineInfos)
|
static void AddNotifications (const Collection* LineInfos)
|
||||||
/* Output additional notifications for an error or warning */
|
/* Output additional notifications for an error or warning */
|
||||||
{
|
{
|
||||||
|
unsigned I;
|
||||||
|
unsigned Skipped;
|
||||||
|
|
||||||
/* The basic line info is always in slot zero. It has been used to
|
/* The basic line info is always in slot zero. It has been used to
|
||||||
* output the actual error or warning. The following slots may contain
|
* output the actual error or warning. The following slots may contain
|
||||||
* more information. Check them and additional notifications if they're
|
* more information. Check them and print additional notifications if
|
||||||
* present.
|
* they're present, but limit the number to a reasonable value.
|
||||||
*/
|
*/
|
||||||
unsigned I;
|
unsigned MaxCount = CollCount (LineInfos);
|
||||||
for (I = 1; I < CollCount (LineInfos); ++I) {
|
if (MaxCount > 6) {
|
||||||
|
MaxCount = 6;
|
||||||
|
}
|
||||||
|
Skipped = CollCount (LineInfos) - MaxCount;
|
||||||
|
for (I = 1; I < MaxCount; ++I) {
|
||||||
/* Get next line info */
|
/* Get next line info */
|
||||||
const LineInfo* LI = CollConstAt (LineInfos, I);
|
const LineInfo* LI = CollConstAt (LineInfos, I);
|
||||||
/* Check the type and output an appropriate note */
|
/* Check the type and output an appropriate note */
|
||||||
@ -139,6 +146,12 @@ static void AddNotifications (const Collection* LineInfos)
|
|||||||
"Macro was defined here");
|
"Macro was defined here");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Add a note if we have more stuff that we won't output */
|
||||||
|
if (Skipped > 0) {
|
||||||
|
PrintMsg (GetSourcePos (CollConstAt (LineInfos, 0)), "Note",
|
||||||
|
"Dropping %u additional line infos", Skipped);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user