[fpc-pascal] FPC happily eats wrong parameters

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Sep 24 15:02:36 CEST 2013


On Tue, 24 Sep 2013 14:28:42 +0200
Sven Barth <pascaldragon at googlemail.com> wrote:

> Am 24.09.2013 14:17, schrieb Mattias Gaertner:
> > Hi,
> >
> > When calling "fpc -d foo test.pas" there are two mistakes:
> > First the -d parameter is missing a value, which fpc silently ignores.
> > And second there are two files to compile. FPC ignores that too, gives
> > a hint, but compiles anyway.
> >
> > Design or bug?
> The '-d' argument is written explicitely to do something only if it has 
> a (directly following) argument. Otherwise it does nothing. If this 
> should be considered a bug or not is up to discussion, but the code is 
> this way at least since the migration to SVN.

Well, maybe the word "bug" is too strong.
It would be a nice feature, if fpc does not let the user shoot his
foot this way. 


> That FPC warns if multiple files are supplied is by design as there is a 
> specific warning about this. FPC will always use the last filename given 
> as mentioned here: 
> http://www.freepascal.org/docs-html/user/userse70.html#x182-189000C.11

Yes, it is this way since at least 2000. I assumed that eventually
fpc will support compiling multiple files. But I guess this will not
happen, so maybe it would be better to change the warning to an error.
A warning is defined as something that is probably wrong, but may be
needed in some cases. Where is the need for passing files that the
compiler ignores?

Mattias



More information about the fpc-pascal mailing list