Make address strobj be equiv int type and remove param checking hack.

This commit is contained in:
David Brown 2016-09-24 12:13:26 +01:00
parent d683df3e72
commit 8ab4057a10
3 changed files with 14 additions and 10 deletions

View file

@ -1380,11 +1380,10 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
WHILE (q # fp^.typ) & (q # NIL) & (q # OPT.undftyp) DO q := q^.BaseTyp END ;
IF q = NIL THEN err(111) END
ELSIF (fp^.typ = OPT.sysptrtyp) & (ap^.typ^.form = OPT.Pointer) THEN (* ok *)
ELSIF (ap^.typ # fp^.typ) THEN
IF (fp^.typ^.form = OPT.Byte) & ((ap.typ.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (ap.typ.size = 1)) THEN (* OK *)
ELSIF (ap.typ = OPT.adrtyp) & (fp.typ = OPT.IntType(ap.typ.size)) THEN (* OK (ADDRESS is changed to INTnn in symbol file) *)
ELSE err(123)
END
ELSIF (ap^.typ # fp^.typ)
& ~( (fp^.typ^.form = OPT.Byte)
& (ap.typ.form IN {OPT.Byte..OPT.Char, OPT.Int})
& (ap.typ.size = 1)) THEN err(123)
ELSIF (fp^.typ^.form = OPT.Pointer) & (ap^.class = OPT.Nguard) THEN err(123)
END
ELSIF fp^.typ^.comp = OPT.DynArr THEN

View file

@ -51,11 +51,15 @@ MODULE Vishap; (* J. Templ 3.2.95 *)
PROCEDURE PropagateElementaryTypeSizes;
VAR adrinttyp: OPT.Struct;
BEGIN
OPT.sysptrtyp.size := OPM.AddressSize;
OPT.adrtyp.size := OPM.AddressSize;
OPT.settyp.size := OPM.SetSize;
adrinttyp := OPT.IntType(OPM.AddressSize);
OPT.adrtyp.strobj := adrinttyp.strobj;
OPT.sinttyp := OPT.IntType(OPM.ShortintSize);
OPT.inttyp := OPT.IntType(OPM.IntegerSize);
OPT.linttyp := OPT.IntType(OPM.LongintSize);

View file

@ -126,26 +126,27 @@ void determineOS() {
#endif
}
#define optimize " -O1"
void determineCCompiler() {
snprintf(libspec, sizeof(libspec), " -l %s", oname);
#if defined(__MINGW32__)
compiler = "mingw";
if (sizeof (void*) == 4) {
cc = "i686-w64-mingw32-gcc -g -O1";
cc = "i686-w64-mingw32-gcc -g" optimize;
} else {
cc = "x86_64-w64-mingw32-gcc -g -O1";
cc = "x86_64-w64-mingw32-gcc -g" optimize;
}
#elif defined(__clang__)
compiler = "clang";
cc = "clang -fPIC -g -O1";
cc = "clang -fPIC -g" optimize;
#elif defined(__GNUC__)
compiler = "gcc";
if (strncasecmp(os, "cygwin", 6) == 0) {
// Avoid cygwin specific warning that -fPIC is ignored.
cc = "gcc -g -O1";
cc = "gcc -g" optimize;
} else {
cc = "gcc -fPIC -g -O1";
cc = "gcc -fPIC -g" optimize;
}
#elif defined(_MSC_VER)
compiler = "MSC";