Peter Gerwinski wrote:
The GNU compiler's global configuration file `specs' (or `specs.gpc' with DJGPP) now contains a line `*gpc1:' after which you can put your site-wide default switches, e.g.
*gpc1: -fextended-pascal -ffield-widths -fno-clip-strings
Note that `specs' does not want `--foo' but `-ffoo'.
BTW: You recently said that one has to use '-pedantic', not '-fpedantic' in specs. Is there a general rule when to use '-f...' and when simply '-...'?
All command-line `--foobar' flags now can be given as compiler directives. One example:
(*$field-widths,NO-clip-strings,SetLimit=1024, AutoMake="-g -O3"*).
Just to make sure: 'AutoMake="--foo"' means that '--foo' is used for the compilation of the units involved and the program itself, while 'AutoMake, --foo' would apply '--foo' only to the program. Is that right?
A minor "problem": If I compile a program with such a compiler switch with TP, TP complains about an "Invalid compiler directive". Is there a way (perhaps a simpler way than conditional defines) to supply the options so that gpc will recognize them and TP will ignore them?
What about compiler options for "-o foo", "foo.o" and/or "bar.c"? Are you working on them, or are they too difficult to implement?
BTW: Is it legal (with the currect version) to use "gpc foo.c bar.pas"? I asked about this already in my mail about "Re: Linking directives..." on 3 Apr, but unfortunately got no replies.
And another contribution to the GPC test suite... :-|
The following program and unit cause the latest gpc to fail with SIGSEGV. It worked with a previous version of gpc:
PROGRAM x; USES y;
VAR v:t;
BEGIN q(v) {or p(v) - both cause SIGSEGV} END.
UNIT Y;
INTERFACE
TYPE t=ARRAY[0..1] OF Integer;
PROCEDURE p(VAR v:t); PROCEDURE q(CONST v:t);
IMPLEMENTATION
PROCEDURE p(VAR v:t); BEGIN END;
PROCEDURE q(CONST v:t); BEGIN END; END.