[fpc-pascal] FPC happily eats wrong parameters

2013-09-24 Thread 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?

Mattias
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC happily eats wrong parameters

2013-09-24 Thread Jonas Maebe


On 24 Sep 2013, at 14:17, Mattias Gaertner wrote:


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?


By design, FPC gives a warning (not a hint) when two file names are  
specified. Accepting an empty -d parameter sounds like a bug though.



Jonas___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC happily eats wrong parameters

2013-09-24 Thread Sven Barth

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.
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


Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC happily eats wrong parameters

2013-09-24 Thread Mattias Gaertner
On Tue, 24 Sep 2013 14:23:52 +0200
Jonas Maebe jonas.ma...@elis.ugent.be wrote:

 
 On 24 Sep 2013, at 14:17, Mattias Gaertner wrote:
 
  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?
 
 By design, FPC gives a warning (not a hint) when two file names are  
 specified. 

You are right, it is a warning.
Why not an error? In what case do you need to pass two files to the
compiler?


 Accepting an empty -d parameter sounds like a bug though.

ok

Mattias
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC happily eats wrong parameters

2013-09-24 Thread Jonas Maebe


On 24 Sep 2013, at 14:34, Mattias Gaertner wrote:


On Tue, 24 Sep 2013 14:23:52 +0200
Jonas Maebe jonas.ma...@elis.ugent.be wrote:


By design, FPC gives a warning (not a hint) when two file names are
specified.


You are right, it is a warning.
Why not an error?


FPC used to silently ignore multiple file names, so I added a warning  
to remain backward compatible but make debugging such issues easier.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC happily eats wrong parameters

2013-09-24 Thread Mattias Gaertner
On Tue, 24 Sep 2013 14:28:42 +0200
Sven Barth pascaldra...@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
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal