[fpc-devel] FmtBCD unit improvements / bugs

2011-03-14 Thread LacaK

Hi,
I would like to ask somebody to look at these bug reports:

1. http://bugs.freepascal.org/view.php?id=18388
This bug report contains implementation of missing BcdToStrF function.
There is also discussion if FmtBCD unit is localized ... tests under 
Delphi (6,10) shows, that Delphi *uses* global variables 
DecimalSeparator (in StrToBCD, BCDToStr, BCDToStrF) and 
ThousandSeparator (in BCDToStrF).


2. http://bugs.freepascal.org/view.php?id=18807
If fix in bug report (1) will be applied, then I can continue by adding 
overloaded functions
TryStrToBCD, StrToBCD, BCDToStr with next parameter const Format: 
TFormatSettings (in style of TryStrToFloat etc. and also in Delphi 
compatible way)

and drop global variable DecimalPoint
and replace its using by either DefaultFormatSettings (when used 
function without Format parameter) or supplied Format parameter. So it 
will be something like this:


 function TryStrToBCD ( const aValue : FmtBCDStringtype;   // --- here 
is not specified Format, so use DefaultFormatSettings

  var BCD : tBCD ) : Boolean;
 begin
   Result:=TryStrToBCD(aValue, BCD, DefaultFormatSettings);
 end;

 function TryStrToBCD ( const aValue : FmtBCDStringtype;
  var BCD : tBCD;
const Format: TFormatSettings  ) : Boolean;  // 
--- here is explicitly specified Format, so use it

...
//here use Format.DecimalSeparator , Format.ThousandSeparator
...

I would like if we make progress in this, because then we can continue 
with other task related to this.
Please let me know if you agree with this direction and if yes, then 
please apply fix in (1) and then I will prepare fix for (2)

Thanks
-Laco.

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


Re: [fpc-devel] Re-installing fpc

2011-03-14 Thread Thomas Schatzl

Hi,

On Mon, 14 Mar 2011 10:48:50 +0100, Michael Schnell wrote:

I re-installed Linux, trashing the root directory while keeping the
user's home directories.

Now I need to re-install fpc (which I provide the newest svn version
to all users in /usr/bin).
[...]

But when I tried to install fpc to /usr/bin with (as root)


make install  requires fpcmake in the path, or invoking it manually 
as you did, or put it into the FPCMAKE environment. I.e. export 
FPCMAKE=/path/to/fpcmake.



make install INSTALL_PREFIX=/usr

I dot some an error message about something missing, but not saying
what would be missing where).

So I copied some flc* files from the old installation to /usr/bin.

not I get

Makefile:199: *** The Makefile doesn't support target
can't-executed,, please run fpcmake first.  Stop.

but when I try to do fpcmake in the source directory this does not
help and when I try to do fpcmake in /usr/bin I get


Did you run fpcmake -R -Tall in the source directory? (-R means 
recursively dive into subdirectories and -Tall means for all targets)



What to do ?


Above should fix the issue.

Thomas

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


Re: [fpc-devel] Re-installing fpc

2011-03-14 Thread Jonas Maebe

On 14 Mar 2011, at 10:48, Michael Schnell wrote:

 sudo make clean all FPC=/home/mschnell/Downloads/fpc/ppc386
 
 To compile fpc just fine.
 
 But when I tried to install fpc to /usr/bin with (as root)
 
 make install INSTALL_PREFIX=/usr


sudo make FPC=`pwd`/compiler/ppc386 install INSTALL_PREFIX=/usr


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


Re: [fpc-devel] Re-installing fpc

2011-03-14 Thread Jonas Maebe

On 14 Mar 2011, at 11:13, Thomas Schatzl wrote:

 On Mon, 14 Mar 2011 10:48:50 +0100, Michael Schnell wrote:
 Makefile:199: *** The Makefile doesn't support target
 can't-executed,, please run fpcmake first.  Stop.
 
 but when I try to do fpcmake in the source directory this does not
 help and when I try to do fpcmake in /usr/bin I get
 
 Did you run fpcmake -R -Tall in the source directory? (-R means recursively 
 dive into subdirectories and -Tall means for all targets)

That should not be necessary, all makefiles in svn contain support for all 
targets. The error The Makefile doesn't support target can't-executed 
indicates that the Makefile tried to execute the compiler to figure out for 
what target it should install files, but could not execute it (hence the 
can't-executed target name).

It's possible that fpcmake also needs to be in the path (I also remember that 
for some reason it's executed during make install), but it's not the cause of 
this particular error.


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


Re: [fpc-devel] Re-installing fpc

2011-03-14 Thread Michael Schnell

On 03/14/2011 11:12 AM, Henry Vermaak wrote:

There is no need to build as root. This is a very bad idea.
OK, I once was not able to do this as a normal user. I was not able to 
find out why. (supposedly some files were owned by root and could not be 
overwritten when making fpc as a user)


OTOH, I think I need to do make install as root if I want to provide fpc 
in /usr/bin to all users.

It's hard to tell without the error message.
This is obvious but right now I don't get this problem any more. I 
suppose I could reproduce it by deleting the fpc* files from /usr/bin.


I now think it's likely that fpcmake had been the file make install 
complained not to have.


Thanks,
-Michael
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Re-installing fpc

2011-03-14 Thread Michael Schnell

On 03/14/2011 11:13 AM, Thomas Schatzl wrote:


make install  requires fpcmake in the path, 
I did copy it to /usr/bin from the old system. (I never updated this 
file, could this be problematic ? )
or invoking it manually as you did, 

..unsuccessfully :(
or put it into the FPCMAKE environment. I.e. export 
FPCMAKE=/path/to/fpcmake.

supposedly not necessary as it can be found in /usr/bin


Did you run fpcmake -R -Tall in the source directory? (-R means 
recursively dive into subdirectories and -Tall means for all targets)

No.

So I did

fpcmake -r -Tall

And this seemed to recreate all make files.

But I still get

Makefile:199: *** The Makefile doesn't support target can't-executed,, 
please run fpcmake first.  Stop.


when I do

make install INSTALL_PREFIX=/usr


Thanks,
-Michael
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Re-installing fpc

2011-03-14 Thread Michael Schnell

On 03/14/2011 11:14 AM, Jonas Maebe wrote:

make FPC=`pwd`/compiler/ppc386 install INSTALL_PREFIX=/usr
This in fact runs seemingly without an error message and creates fpc 
and 32 more files in /usr/bin.


(Making me wonder why I did not need the parameter 
FPC=`pwd`/compiler/ppc386 before reinstalling Linux.)


But when doing fpc I get

Error: ppc386 can't be executed, error message: Failed to execute 
ppc386, error code: 127


And in fact ppc386 is not in /usr/bin

What did I do wrong ?

Thanks a lot,
-Michael
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Re-installing fpc

2011-03-14 Thread Jonas Maebe

On 14 Mar 2011, at 13:15, Michael Schnell wrote:

 On 03/14/2011 11:14 AM, Jonas Maebe wrote:
 make FPC=`pwd`/compiler/ppc386 install INSTALL_PREFIX=/usr
 This in fact runs seemingly without an error message and creates fpc and 32 
 more files in /usr/bin.
 
 (Making me wonder why I did not need the parameter FPC=`pwd`/compiler/ppc386 
 before reinstalling Linux.)

Because you had a ppc386 in the path, which the Makefile found by itself.

 But when doing fpc I get
 
 Error: ppc386 can't be executed, error message: Failed to execute ppc386, 
 error code: 127
 
 And in fact ppc386 is not in /usr/bin
 
 What did I do wrong ?

make install does not create any symbolic links to change the default 
compiler to the newly installed one (because normally the latest released 
version should remain the default compiler, since it's the only one with which 
you can safely compile newer compiler versions). So if you want to overwrite or 
create it:

cd compiler
make FPC=./ppc386 installsymlink


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


Re: [fpc-devel] Re-installing fpc

2011-03-14 Thread Michael Schnell

On 03/14/2011 01:20 PM, Jonas Maebe wrote:

make FPC=./ppc386 installsymlink
Sorry for my silliness but I really fail to understand this complex 
stuff and can't help myself here.


I got this:

mschnell-Linux:/home/mschnell/Downloads/svn/fpc/trunk # cd compiler/

mschnell-Linux:/home/mschnell/Downloads/svn/fpc/trunk/compiler # ls -l 
ppc386

-rwxr-xr-x 1 root root 2349836 Mar 14 12:46 ppc386

mschnell-Linux:/home/mschnell/Downloads/svn/fpc/trunk/compiler # make 
FPC=./ppc386 installsymlink

make -C utils install
make[1]: Entering directory 
`/home/mschnell/Downloads/svn/fpc/trunk/compiler/utils'

Makefile:135: *** Compiler ./ppc386 not found.  Stop.
make[1]: Leaving directory 
`/home/mschnell/Downloads/svn/fpc/trunk/compiler/utils'

make: *** [utils_install] Error 2


:-(

Thanks
-Michael
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Re-installing fpc

2011-03-14 Thread Jonas Maebe

On 14 Mar 2011, at 14:14, Michael Schnell wrote:

 On 03/14/2011 01:20 PM, Jonas Maebe wrote:
 make FPC=./ppc386 installsymlink
 Sorry for my silliness but I really fail to understand this complex stuff and 
 can't help myself here.

make FPC=`pwd`/ppc386 installsymlink


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


Re: [fpc-devel] Re-installing fpc

2011-03-14 Thread Henry Vermaak

On 14/03/11 13:16, Jonas Maebe wrote:


On 14 Mar 2011, at 14:14, Michael Schnell wrote:


On 03/14/2011 01:20 PM, Jonas Maebe wrote:

make FPC=./ppc386 installsymlink

Sorry for my silliness but I really fail to understand this complex stuff and 
can't help myself here.


make FPC=`pwd`/ppc386 installsymlink


Hmm, I guess the Makefiles should really use $(realpath ...).

Henry
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] (class) helper questions

2011-03-14 Thread Sven Barth

On 09.03.2011 02:17, Paul Ishenin wrote:

4. The syntax that was introduced by Borland is not very pascalish in my
opinion. So I'd like to change the syntax for mode ObjFPC a bit (sadly
this won't simplify the parser anymore because of the Delphi
compatibility).

Delphi syntax:

TypeIdentifier = class|record helper(ParentHelper) for ExtendedType

Proposed FPC syntax:

TypeIdentifier = helper(ParentHelper) for class|record ExtendedType

What do you think? Maybe also the class|record part can be left out,
because this part is not saved in the objectdef and can be determined by
the compiler automatically.


I always think that if there is no need to create an incompatibility -
better to not create it. But my ideas often does not get support of
other FPC developers.


I have tought about this topic a bit more. On the one hand I still want 
a cleaner syntax for this, but on the other hand I also understand that 
others want to have the ability to use objfpc code in Delphi with as 
less ifdefs as possible (or the other way round).


So what about the following compromise:
I will add my proposed syntax, but the Delphi compatible one can be 
activated with a mode switch (which will be enabled by default in mode 
Delphi).
And if you really insist very hard to have mode ObjFPC compatible with 
mode Delphi, I can also live with the switch meaning enable non 
compatible syntax and being disabled by default.


I plan to do something similar when RTTI attributes are implemented 
(either by me or someone else) as well, so the modeswitch will have its 
use there, too.


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


Re: [fpc-devel] (class) helper questions

2011-03-14 Thread Jonas Maebe

On 14 Mar 2011, at 21:07, Sven Barth wrote:

 I have tought about this topic a bit more. On the one hand I still want a 
 cleaner syntax for this, but on the other hand I also understand that others 
 want to have the ability to use objfpc code in Delphi with as less ifdefs 
 as possible (or the other way round).

It's not just that. It's also that it adds extra code to the compiler that must 
be maintained and that makes the parser more complicated.


JHonas___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] (class) helper questions

2011-03-14 Thread Paul Ishenin

15.03.2011 3:22, Jonas Maebe wrote:

On 14 Mar 2011, at 21:07, Sven Barth wrote:


I have tought about this topic a bit more. On the one hand I still want a cleaner syntax 
for this, but on the other hand I also understand that others want to have the ability to 
use objfpc code in Delphi with as less ifdefs as possible (or the other way 
round).

It's not just that. It's also that it adds extra code to the compiler that must 
be maintained and that makes the parser more complicated.

+1

Also from time to time we find bugs in another proposed syntax and that 
other syntax becomes removed.


Best regards,
Paul Ishenin
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel