[fpc-pascal] FPC Docs updated

2010-03-06 Thread Michael Van Canneyt
Hi, The documentation has been re-generated and put on the website. the fpc/dist/2.4.0/docs directory on the FTP server contains also a version of the latest docs. They have been re-generated from version 2.4.0. Reason for the update is the complete documentation of the DB unit: it has been

[fpc-pascal] Is it save to think default value of untouched string is ''?

2010-03-06 Thread lyh1
I have a a program that will read a string and parse the string to some sub-strings in sub routine. I add every character to a local string buffer in sub routine. The code work well in delphi but suddenly fail in fpc. When I watch the buffer, it display some garbage instead of null string when

Re: [fpc-pascal] Is it save to think default value of untouched string is ''?

2010-03-06 Thread Jonas Maebe
On 06 Mar 2010, at 21:13, lyh1 wrote: My question is we should always assign null string to variable before use or this a bug if I get garbage in unused string? If you want Delphi-compatible behaviour, you must add {$mode delphi} at the top of your program. In the default mode, string is an

Re: [fpc-pascal] Is it save to think default value of untouched string is ''?

2010-03-06 Thread Jonas Maebe
On 06 Mar 2010, at 22:03, Juha Manninen wrote: If you want Delphi-compatible behaviour, you must add {$mode delphi} at the top of your program. In the default mode, string is an alias for shortstring instead of ansistring ({$h-} mode). And even then you should initialize strings. They are

[fpc-pascal] Smartlinking public functions

2010-03-06 Thread dmitry boyarintsev
Hello Developers The system expects an application to implement (export) some functions that are to be linked statically. I'm using [public] modifier: function someFunc: Integer cdecl; [public]; alias: '_someFunc'; The linker catches up the function and statically links it with the system

Re[2]: [fpc-pascal] Is it save to think default value of untouched string is ''?

2010-03-06 Thread JoshyFun
Hello FPC-Pascal, Saturday, March 6, 2010, 10:03:49 PM, you wrote: If you want Delphi-compatible behaviour, you must add {$mode delphi} at the top of your program. In the default mode, string is an alias for shortstring instead of ansistring ({$h-} mode). JM And even then you should

Re: [fpc-pascal] Smartlinking public functions

2010-03-06 Thread Jonas Maebe
On 06 Mar 2010, at 22:05, dmitry boyarintsev wrote: This would prevent the smartlinking, but is there more beautiful way to prevent a function from being smartlinked? No. And even if we would add a special modifier for that, I don't know how it could be easily implemented for non-Mac OS X

Re: [fpc-pascal] Smartlinking public functions

2010-03-06 Thread dmitry boyarintsev
On Sat, Mar 6, 2010 at 9:14 PM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: No. And even if we would add a special modifier for that, I don't know how it could be easily implemented for non-Mac OS X platforms (although I realise that you probably need this for Mac OS X, a generic modifier

Re: [fpc-pascal] Smartlinking public functions

2010-03-06 Thread Jonas Maebe
On 06 Mar 2010, at 22:17, dmitry boyarintsev wrote: On Sat, Mar 6, 2010 at 9:14 PM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: No. And even if we would add a special modifier for that, I don't know how it could be easily implemented for non-Mac OS X platforms (although I realise that you

Re: [fpc-pascal] Smartlinking public functions

2010-03-06 Thread dmitry boyarintsev
Thanks for your help! ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Is it save to think default value of untouched string is ''?

2010-03-06 Thread Juha Manninen
Sorry ... What ? It must be garanteed in ansistring mode! or everything will simple kboom! There is no way to initialize a non initialized string. By initializing I mean: str:=''; or some other assignment. I remember having garbage in strings in Delphi when I assumed they are empty. Or was

Re: [fpc-pascal] Is it save to think default value of untouched string is ''?

2010-03-06 Thread Bart
I thought only global variables were initialized to zero and local ones were just cereated on the stack? Bart ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Is it save to think default value of untouched string is ''?

2010-03-06 Thread Jonas Maebe
On 07 Mar 2010, at 00:13, Juha Manninen wrote: I remember having garbage in strings in Delphi when I assumed they are empty. Or was it only with function's string return value, I am not sure. Anyway, after that I was careful to always assign my strings. You're right that it can be different

Re: [fpc-pascal] Is it save to think default value of untouched string is ''?

2010-03-06 Thread Mattias Gaertner
On Sun, 7 Mar 2010 01:13:05 +0200 Juha Manninen juha.manni...@phnet.fi wrote: Sorry ... What ? It must be garanteed in ansistring mode! or everything will simple kboom! There is no way to initialize a non initialized string. By initializing I mean: str:=''; or some other assignment.