[fpc-devel]Simple source for MAKE & 0th param test

XHajT03 at mbox.vol.cz XHajT03 at mbox.vol.cz
Sat Nov 11 23:07:58 CET 2000


Date sent:      	Fri, 10 Nov 2000 23:36:49 +0900
From:           	KO Myung-Hun <komh at chollian.net>
To:             	FPC mail <fpc-devel at lists.freepascal.org>
Subject:        	[fpc-devel]Simple source for MAKE & 0th param test
Send reply to:  	fpc-devel at deadlock.et.tudelft.nl

   Hi,

> This is a simple source for MAKE & 0th parameter test.
> 
> ---------- maketest.pas
> program MakeTest;
> 
> uses
>     Dos;

 I don't think unit Dos is needed here, BTW.

> begin
>     WriteLn( '----- MakeTest report ----- ' );
>     WriteLn( 'ParamStr( 0 ) : ', ParamStr( 0 ));
>     WriteLn( 'argv[ 0 ] : ', argv[ 0 ]);
> end.
> --------
> 
> -------- makefile
> default :
>         maketest.exe
> --------
> 
> If you run make and maketest, you could recognize difference of both.
> 
> I guess that this is a bug of MAKE because a program compiled by GCC
> also
> cause the same result.

 Well, I've probably found the reason now. First, it isn't a problem 
with MAKE - a simple program with just one "Exec ('maketest.exe', 
'')" line shows the same behaviour. In fact, it seems to be a bug in 
our ParamStr (0) implementation. The problem is, that some command 
shells (e.g. 4os2 or FC/2 - not a real shell, right, but used that 
way) expand the called program to full path automatically; that's why 
we thought it works. Just try running your maketest.exe under plain 
CMD.EXE, you'll probably see the same result as with make. We'll have 
to fix it.
 Another valuable bug report - keep them coming. ;-)

Tomas





More information about the fpc-devel mailing list