Skip to content

Commit b895d59

Browse files
Alfred ArnoldKubaO
Alfred Arnold
authored andcommitted
asl-current-142-bld17
1 parent e4e4f0b commit b895d59

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+1911
-279
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ install: $(ALLTARGETS)
6666
./install.sh $(BINDIR) $(INCDIR) $(MANDIR) $(LIBDIR) $(DOCDIR)
6767

6868
clean:
69-
rm -f $(ALLTARGETS) $(RESCOMPTARGET) $(TEX2DOCTARGET) $(TEX2HTMLTARGET) *.$(OBJEXTENSION) *.p *.rsc tests/testlog
69+
rm -f $(ALLTARGETS) $(RESCOMPTARGET) $(TEX2DOCTARGET) $(TEX2HTMLTARGET) *.$(OBJEXTENSION) *.p *.rsc tests/testlog testlog
7070
cd doc_DE; $(MAKE) RM="rm -f" clean
7171
cd doc_EN; $(MAKE) RM="rm -f" clean
7272

@@ -139,7 +139,7 @@ unjunk:
139139
nops.asm bind.* asmutils.* asmmessages.* filenums.* includelist.* tests/warnlog_* \
140140
insttree.* flt1750.* t_65.* test87c8.* testst9.* testst7.* testtms7.* test3203.* \
141141
ioerrors.new.c codeallg.* ASM*.c *_msg*.h p2BIN.* \
142-
decodecmd.* ioerrors.* stringutil.* *split.c marks.c \
142+
decodecmd.* ioerrors.* stringutil.* *split.c marks.c equs.h \
143143
`find . -name "testlog" -print` \
144144
`find . -name "*~" -print` \
145145
`find . -name "core" -print` \

Makefile.def-samples/Makefile.def-i386-unknown-linux2.x.x

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
CC = gcc
66
LD = gcc
7-
CFLAGS = -g -O3 -m486 -fomit-frame-pointer -Wall
7+
CFLAGS = -g -O3 -mcpu=i486 -fomit-frame-pointer -Wall
88
LDFLAGS =
99
# ^^^^^
1010
# |||||

Makefile.def-samples/Makefile.def-i386-unknown-win32

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
CC = gcc
99
LD = gcc
10-
CFLAGS = -O2 -Wall -Wno-parentheses -Wno-sign-compare
10+
CFLAGS = -O2 -mcpu=i486 -Wall -Wno-parentheses -Wno-sign-compare
1111
LDFLAGS =
1212

1313
# -------------------------------------------------------------------------

Makefile.os2

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ clean:
7070
-del $(RESCOMPTARGET)
7171
-del *.$(OBJEXTENSION)
7272
-del *.p
73+
-del tests/testlog
7374
-del testlog
7475
-del *.rsc
7576
cd doc_DE & $(MAKE) RM=del clean

Makefile.w32

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ install: $(ALLTARGETS)
6666
./install.sh $(BINDIR) $(INCDIR) $(MANDIR) $(LIBDIR) $(DOCDIR)
6767

6868
clean:
69-
rm -f $(ALLTARGETS) $(RESCOMPTARGET) $(TEX2DOCTARGET) $(TEX2HTMLTARGET) *.$(OBJEXTENSION) *.p *.rsc tests/testlog
69+
rm -f $(ALLTARGETS) $(RESCOMPTARGET) $(TEX2DOCTARGET) $(TEX2HTMLTARGET) *.$(OBJEXTENSION) *.p *.rsc tests/testlog testlog
7070
cd doc_DE; $(MAKE) RM="rm -f" clean
7171
cd doc_EN; $(MAKE) RM="rm -f" clean
7272

as.c

+128-57
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
/* 9. 6.2001 moved initialization of DoPadding before CPU-specific*/
5353
/* initialization, to allow CPU-specific override */
5454
/* 2001-07-07 added intiialization of C54x generator */
55+
/* 2001-10-20 GNU error style possible */
5556
/* */
5657
/*****************************************************************************/
5758

@@ -1457,33 +1458,34 @@ BEGIN
14571458
String Tmp;
14581459
UNUSED(PInp);
14591460

1460-
sprintf(Tmp,LongIntFormat,CurrLine);
1461-
sprintf(dest,"%s(%s) ",NamePart(CurrFileName),Tmp);
1462-
return True;
1461+
sprintf(Tmp, LongIntFormat, PInp->LineZ);
1462+
sprintf(dest, GNUErrors ? "%s:%s" : "%s(%s) ", NamePart(PInp->SpecName), Tmp);
1463+
return !GNUErrors;
14631464
END
14641465

14651466
Boolean INCLUDE_Processor(PInputTag PInp, char *Erg)
14661467
BEGIN
14671468
Boolean Result;
14681469

1469-
Result=True;
1470+
Result = True;
14701471

1471-
if (feof(PInp->Datei)) *Erg='\0';
1472+
if (feof(PInp->Datei))
1473+
*Erg = '\0';
14721474
else
14731475
BEGIN
1474-
ReadLn(PInp->Datei,Erg);
1476+
ReadLn(PInp->Datei, Erg);
14751477
/**ChkIO(10003);**/
14761478
END
1477-
CurrLine=(++MomLineCounter);
1478-
if (feof(PInp->Datei)) Result=False;
1479+
PInp->LineZ = CurrLine = (++MomLineCounter);
1480+
if (feof(PInp->Datei)) Result = False;
14791481

14801482
return Result;
14811483
END
14821484

14831485
static void INCLUDE_Restorer(PInputTag PInp)
14841486
BEGIN
14851487
MomLineCounter=PInp->StartLine;
1486-
strmaxcpy(CurrFileName,PInp->SpecName,255);
1488+
strmaxcpy(CurrFileName,PInp->SaveAttr,255);
14871489
IncDepth--;
14881490
END
14891491

@@ -1520,7 +1522,8 @@ BEGIN
15201522
/* Sicherung alter Daten */
15211523

15221524
Tag->StartLine=MomLineCounter;
1523-
strmaxcpy(Tag->SpecName,CurrFileName,255);
1525+
strmaxcpy(Tag->SpecName, ArgPart, 255);
1526+
strmaxcpy(Tag->SaveAttr, CurrFileName, 255);
15241527

15251528
/* Datei oeffnen */
15261529

@@ -1530,7 +1533,7 @@ BEGIN
15301533

15311534
/* neu besetzen */
15321535

1533-
strmaxcpy(CurrFileName,ArgPart,255); MomLineCounter=0;
1536+
strmaxcpy(CurrFileName,ArgPart,255); Tag->LineZ = MomLineCounter = 0;
15341537
NextIncDepth++; AddFile(ArgPart);
15351538
PushInclude(ArgPart);
15361539

@@ -1570,23 +1573,81 @@ BEGIN
15701573
END
15711574

15721575
char *GetErrorPos(void)
1573-
BEGIN
1576+
{
15741577
String ActPos;
15751578
PInputTag RunTag;
15761579
char *ErgPos=strdup(""),*tmppos;
15771580
Boolean Last;
15781581

1579-
for (RunTag=FirstInputTag; RunTag!=Nil; RunTag=RunTag->Next)
1580-
BEGIN
1581-
Last=RunTag->GetPos(RunTag,ActPos);
1582-
tmppos=(char *) malloc(strlen(ErgPos)+strlen(ActPos)+1);
1583-
strcpy(tmppos,ActPos); strcat(tmppos,ErgPos);
1584-
free(ErgPos); ErgPos=tmppos;
1585-
if (Last) break;
1586-
END
1582+
/* for GNU error message style: */
1583+
1584+
if (GNUErrors)
1585+
{
1586+
PInputTag InnerTag = NULL;
1587+
Boolean First = TRUE;
1588+
char *Msg;
1589+
1590+
/* we only honor the include positions. First, print the upper include layers... */
1591+
1592+
for (RunTag = FirstInputTag; RunTag; RunTag = RunTag->Next)
1593+
if (RunTag->GetPos == INCLUDE_GetPos)
1594+
{
1595+
if (!InnerTag)
1596+
InnerTag = RunTag;
1597+
else
1598+
{
1599+
Last = RunTag->GetPos(RunTag, ActPos);
1600+
if (First)
1601+
{
1602+
Msg = getmessage(Num_GNUErrorMsg1);
1603+
tmppos = (char *) malloc(strlen(Msg) + 1 + strlen(ActPos) + 1);
1604+
sprintf(tmppos, "%s %s", Msg, ActPos);
1605+
}
1606+
else
1607+
{
1608+
Msg = getmessage(Num_GNUErrorMsgN);
1609+
tmppos = (char *) malloc(strlen(ErgPos) + 2 + strlen(Msg) + 1 + strlen(ActPos) + 1);
1610+
sprintf(tmppos, "%s,\n%s %s", ErgPos, Msg, ActPos);
1611+
}
1612+
First = False;
1613+
free(ErgPos); ErgPos = tmppos;
1614+
}
1615+
}
1616+
1617+
/* ...append something... */
1618+
1619+
if (*ErgPos)
1620+
{
1621+
tmppos = (char *) malloc(strlen(ErgPos) + 2);
1622+
sprintf(tmppos, "%s:\n", ErgPos);
1623+
free(ErgPos); ErgPos = tmppos;
1624+
}
1625+
1626+
/* ...then the innermost one */
1627+
1628+
if (InnerTag)
1629+
{
1630+
InnerTag->GetPos(InnerTag, ActPos);
1631+
tmppos = (char *) malloc(strlen(ErgPos) + strlen(ActPos) + 1);
1632+
sprintf(tmppos, "%s%s", ErgPos, ActPos);
1633+
free(ErgPos); ErgPos = tmppos;
1634+
}
1635+
}
1636+
1637+
/* otherwise the standard AS position generator: */
1638+
1639+
else
1640+
for (RunTag = FirstInputTag; RunTag != Nil; RunTag = RunTag->Next)
1641+
{
1642+
Last = RunTag->GetPos(RunTag, ActPos);
1643+
tmppos = (char *) malloc(strlen(ErgPos) + strlen(ActPos) + 1);
1644+
strcpy(tmppos, ActPos); strcat(tmppos, ErgPos);
1645+
free(ErgPos); ErgPos = tmppos;
1646+
if (Last) break;
1647+
}
15871648

15881649
return ErgPos;
1589-
END
1650+
}
15901651

15911652
static Boolean InputEnd(void)
15921653
BEGIN
@@ -2774,6 +2835,14 @@ BEGIN
27742835
return CMDOK;
27752836
END
27762837

2838+
static CMDResult CMD_GNUErrors(Boolean Negate, char *Arg)
2839+
BEGIN
2840+
UNUSED(Arg);
2841+
2842+
GNUErrors = NOT Negate;
2843+
return CMDOK;
2844+
END
2845+
27772846
static CMDResult CMD_IncludeList(Boolean Negate, char *Arg)
27782847
BEGIN
27792848
char *p;
@@ -3022,43 +3091,44 @@ BEGIN
30223091
exit(4);
30233092
END
30243093

3025-
#define ASParamCnt 35
3094+
#define ASParamCnt 36
30263095
static CMDRec ASParams[ASParamCnt]=
3027-
{{"A" , CMD_BalanceTree},
3028-
{"ALIAS", CMD_CPUAlias},
3029-
{"a" , CMD_ShareAssembler},
3030-
{"C" , CMD_CrossList},
3031-
{"c" , CMD_ShareC},
3032-
{"CPU" , CMD_SetCPU},
3033-
{"D" , CMD_DefSymbol},
3034-
{"E" , CMD_ErrorPath},
3035-
{"g" , CMD_DebugMode},
3036-
{"G" , CMD_CodeOutput},
3037-
{"h" , CMD_HexLowerCase},
3038-
{"i" , CMD_IncludeList},
3039-
{"I" , CMD_MakeIncludeList},
3040-
{"L" , CMD_ListFile},
3041-
{"l" , CMD_ListConsole},
3042-
{"M" , CMD_MacroOutput},
3043-
{"n" , CMD_NumericErrors},
3044-
{"NOICEMASK", CMD_NoICEMask},
3045-
{"o" , CMD_OutFile},
3046-
{"P" , CMD_MacProOutput},
3047-
{"p" , CMD_SharePascal},
3048-
{"q" , CMD_QuietMode},
3049-
{"QUIET", CMD_QuietMode},
3050-
{"r" , CMD_MsgIfRepass},
3051-
{"s" , CMD_SectionList},
3052-
{"SHAREOUT", CMD_ShareOutFile},
3053-
{"OLIST", CMD_ListOutFile},
3054-
{"t" , CMD_ListMask},
3055-
{"u" , CMD_UseList},
3056-
{"U" , CMD_CaseSensitive},
3057-
{"w" , CMD_SuppWarns},
3058-
{"WARNRANGES", CMD_HardRanges},
3059-
{"x" , CMD_ExtendErrors},
3060-
{"X" , CMD_MakeDebug},
3061-
{"Y" , CMD_ThrowErrors}};
3096+
{{"A" , CMD_BalanceTree},
3097+
{"ALIAS" , CMD_CPUAlias},
3098+
{"a" , CMD_ShareAssembler},
3099+
{"C" , CMD_CrossList},
3100+
{"c" , CMD_ShareC},
3101+
{"CPU" , CMD_SetCPU},
3102+
{"D" , CMD_DefSymbol},
3103+
{"E" , CMD_ErrorPath},
3104+
{"g" , CMD_DebugMode},
3105+
{"G" , CMD_CodeOutput},
3106+
{"GNUERRORS" , CMD_GNUErrors},
3107+
{"h" , CMD_HexLowerCase},
3108+
{"i" , CMD_IncludeList},
3109+
{"I" , CMD_MakeIncludeList},
3110+
{"L" , CMD_ListFile},
3111+
{"l" , CMD_ListConsole},
3112+
{"M" , CMD_MacroOutput},
3113+
{"n" , CMD_NumericErrors},
3114+
{"NOICEMASK" , CMD_NoICEMask},
3115+
{"o" , CMD_OutFile},
3116+
{"P" , CMD_MacProOutput},
3117+
{"p" , CMD_SharePascal},
3118+
{"q" , CMD_QuietMode},
3119+
{"QUIET" , CMD_QuietMode},
3120+
{"r" , CMD_MsgIfRepass},
3121+
{"s" , CMD_SectionList},
3122+
{"SHAREOUT" , CMD_ShareOutFile},
3123+
{"OLIST" , CMD_ListOutFile},
3124+
{"t" , CMD_ListMask},
3125+
{"u" , CMD_UseList},
3126+
{"U" , CMD_CaseSensitive},
3127+
{"w" , CMD_SuppWarns},
3128+
{"WARNRANGES" , CMD_HardRanges},
3129+
{"x" , CMD_ExtendErrors},
3130+
{"X" , CMD_MakeDebug},
3131+
{"Y" , CMD_ThrowErrors}};
30623132

30633133
/*--------------------------------------------------------------------------*/
30643134

@@ -3204,6 +3274,7 @@ BEGIN
32043274
NumericErrors = False; DebugMode = DebugNone; CaseSensitive = False;
32053275
ThrowErrors = False; HardRanges = True;
32063276
NoICEMask = 1 << SegCode;
3277+
GNUErrors = False;
32073278

32083279
LineZ=0;
32093280

as.h

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#ifndef _AS_H
2+
#define _AS_H
13
/* as.h */
24
/*****************************************************************************/
35
/* AS-Portierung */
@@ -9,3 +11,4 @@
911
/*****************************************************************************/
1012

1113
extern char *GetErrorPos(void);
14+
#endif /* _AS_H */

0 commit comments

Comments
 (0)