From: uz Date: Wed, 28 Dec 2011 16:00:16 +0000 (+0000) Subject: Make the error message for large alignments more descriptive. Don't use the X-Git-Tag: V2.13.3~124 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5bcbb39bba0cb81fa94b1f9297de49c2292c1b55;p=cc65 Make the error message for large alignments more descriptive. Don't use the real number of fill bytes for an alignment, we didn't accept anyway. git-svn-id: svn://svn.cc65.org/cc65/trunk@5340 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/ca65/segment.c b/src/ca65/segment.c index a1c2aed27..00ac6234e 100644 --- a/src/ca65/segment.c +++ b/src/ca65/segment.c @@ -292,7 +292,14 @@ void SegAlign (unsigned long Alignment, int FillVal) */ CombinedAlignment = LeastCommonMultiple (ActiveSeg->Align, Alignment); if (CombinedAlignment > MAX_ALIGNMENT) { - Error ("Combined alignment for active segment exceeds 0x10000"); + Error ("Combined alignment for active segment is %lu which exceeds %lu", + CombinedAlignment, MAX_ALIGNMENT); + + /* Avoid creating large fills for an object file that is thrown away + * later. + */ + Count = 1; + } else { ActiveSeg->Align = CombinedAlignment; @@ -301,12 +308,12 @@ void SegAlign (unsigned long Alignment, int FillVal) Warning (0, "Combined alignment is suspiciously large (%lu)", CombinedAlignment); } - } + /* Calculate the number of fill bytes */ + Count = AlignCount (ActiveSeg->PC, Alignment) - ActiveSeg->PC; + } - /* Calculate the number of fill bytes */ - Count = AlignCount (ActiveSeg->PC, Alignment) - ActiveSeg->PC; /* Emit the data or a fill fragment */ if (FillVal != -1) {