Adriaan van Os wrote:
Included is a diff that improves the employability of the --mac-pascal dialect. Previously, several language constructs available in GNU Pascal and in Macintosh Pascal compilers were rejected by gpc in --mac-pascal mode. I hope that with this diff most of them have been catched now.
I see one problem with the diff:
"-fignore-garbage-after-dot",
"-flongjmp-all-nonlocal-labels", "-fno-mixed-comments",
"-flongjmp-all-nonlocal-labels" has nothing to do with the dialect. I understand that it make sense to make "-flongjmp-all-nonlocal-labels" default on Mac OSX, but I is very confusing if dialect options change generated code, especially if it is a workaround for backend bugs.
The new gpc builds and passes the testsuite on powerpc-apple-darwin.
A few places in the source of the gpc compiler are unclear to me. They include:
- predef.c line 423 chk_dialect ("direct access to files without declared domain is",
B_D_PASCAL);
Extended Pascal standard allows direct acces to files only if you declare an index type like:
var direct_file : file [0..Maxint] of char;
predef.c line 713
flags = (co->pascal_dialect & (CLASSIC_PASCAL_LEVEL_0 |
CLASSIC_PASCAL_LEVEL_1)) ? NEG_ZERO_WIDTH_ERROR_MASK : (co->pascal_dialect & E_O_PASCAL) ? NEG_WIDTH_ERROR_MASK : (co->pascal_dialect & B_D_PASCAL) ? 0 : NEG_WIDTH_LEFT_MASK;
From `rts/constants.h':
#define NEG_ZERO_WIDTH_ERROR_MASK 8 COMMENT ((give an error when field width < 0)) #define NEG_WIDTH_ERROR_MASK 16 COMMENT ((give an error when field width < 0)) #define NEG_WIDTH_LEFT_MASK 32 COMMENT ((left adjusted output when the field width < 0))
There was a disscusion how GPC should handle negative width specification for `Write'. The code above implements results of the disscusion.
expressions.c line 124
chk_dialect ("string concatenation without `Concat' or `+' is",
B_D_PASCAL);
That line check for thins like this:
program hell; begin writeln('Hell' 'o World') end .
--- Waldek Hebisch hebisch@math.uni.wroc.pl