According to Frank Heckenbach:
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 '-...'?
AFAIK, the GNU compiler originally accepted only `-ffoo-bar' flags. (The `-f' stands for "flag".) Nowadays, just `--' is okay as an alternative for `-f'. (Note that these long options start with two dashes, not just one.) The `specs' file only understands the old syntax.
`--pedantic' is an exception, because it is originally `-pedantic' (with one dash), not `-fpedantic' (i.e. no "flag" in this sense).
To get all options, read the (loooooooooooong) section "Invoking GPC" from the info documentation, and pick up the flags not explained there from my "New Alpha" announcements. In the worst case, look at the GPC source file `gpc-options.h' for a list of all `--' (or `-f') options, and see `gpc-decl.c' for what they do.
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?
Almost. Within the directive, `--' (in fact: `-f') is automatically prefixed, so don't give it explicitly.
(*$AutoMake="--foo"*) correct; gives `--foo' to the compilation of Units (*$AutoMake="foo"*) wrong; gives `foo' to the compilation of Units (which is nonsense) (*$AutoMake,foo*) correct; gives `--foo' to the current compilation (*$AutoMake,--foo*) wrong; gives `----foo' (in fact: `-f--foo') to the current compilation.
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 [...] to supply the options so that gpc will recognize them and TP will ignore them?
Yes, conditional defines. GPC pre-defines the symbol "__GPC__":
(*$ifdef __GPC__ *) (* GNU Pascal switches *) (*$no-field-widths *) (*$AutoMake="--foo --bar"*) (*$N+*) (* Nested comments *) (*$E-*) (* No C-style char escapes *) (*$else *) (* Borland Pascal switches *) (*$M 65536 *) (* Stack size *) (*$N+*) (* Numeric coprocessor on *) (*$E-*) (* Don't link the Emulator *) (*$endif *) (* Switches for both compilers *) (*$B-*) (* Short-circuit Boolean operators *)
(perhaps a simpler way than conditional defines)
What would you consider "simpler" than this? ;-)
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?
Working on them. I don't expect much trouble from (*$L foo.o *) and (*$L bar.c *), but I am not so sure about "-o foo" ...
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.
Oh - sorry, I overlooked it. #-) Yes, it's legal, and it works on my Linux box, too. (You wrote that it didn't work on yours; perhaps this bug is fixed now?)
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 [...]
I can reproduce the error. Okay, it will be fixed in the next Alpha. (I hope at least.;)
Greetings,
Peter
Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [970201] maintainer GNU Pascal [970412] - http://home.pages.de/~gnu-pascal/ [970125]