Re: [fpc-pascal] Cross Compiling from Linux to a Mac OS X 10.5 or 10.6 target. How?

2011-08-01 Thread Jonas Maebe
On 01 Aug 2011, at 09:49, Bruce Tulloch wrote: The information on the FPC wiki and elsewhere in the lists is woefully out of date. In general, this is not supported (and personally I've never done it). You have to build an Apple tool chain (assembler, linker) on a Linux host, which is not

Re: [fpc-pascal] Unicode output on console works for me on Linux, not on Windows

2011-08-01 Thread Jonas Maebe
On 01 Aug 2011, at 08:09, Reinier Olislagers wrote: I tried to output Unicode text to console on English Windows Vista (using Lucida Console font, which shows Greek and Cyrillic characters). Doesn't seem to work. I think that you have to configure the console to use UTF-8 output (but I

Re: [fpc-pascal] sdlutils on linux 64 bits

2011-08-01 Thread Jonas Maebe
On 31 Jul 2011, at 23:11, Daniel Gaspary wrote: The last activity on this unit seems to be from 2008. Any new solution or workaround to make the code compatible ? It's a third party unit that was imported from JEDI-SDL. It was even deleted in the past because it wasn't part of the

Re: [fpc-pascal] x86-64 vs x86_64 vs x64

2011-08-03 Thread Jonas Maebe
On 03 Aug 2011, at 14:11, Graeme Geldenhuys wrote: So here is to anybody that knows: What is the difference between a target x86-64, target x86_64 and a target x64? None. The target names are simple strings in the compiler/i_*.pas files and unrelated to the code generation. Jonas

Re: [fpc-pascal] Cross Compiling from Linux to a Mac OS X 10.5 or 10.6 target. How?

2011-08-04 Thread Jonas Maebe
On 04 Aug 2011, at 15:13, Bruce Tulloch wrote: So I've got cross-compilation working but I have one last problem. I can't seem to get fpc to drive the linker to search the SDK path BEFORE the default paths. Specifically, i386-darwin-ld finds /usr/lib/crt1.o and NOT

Re: [fpc-pascal] Re: FreePascal as an embedded language in Firebird: possible and desirable?

2011-08-09 Thread Jonas Maebe
On 09 Aug 2011, at 17:04, Jim wrote: 4. I just tried to open up communication and provide a way for both sides to communicate and keep track of things. The problem is that this is generally not how things actually get implemented in open source software. Things get implemented by someone

Re: [fpc-pascal] Working Free Pascal android JNI example

2011-08-10 Thread Jonas Maebe
On 10 Aug 2011, at 12:10, Felipe Monteiro de Carvalho wrote: On Wed, Aug 10, 2011 at 11:59 AM, Thomas Schatzl tom_at_w...@gmx.at wrote: However, you might want to use the hack from http://mantis.freepascal.org/view.php?id=18833 on android for now. What do you think about merging this hack

Re: [fpc-pascal] Re: timer_create on linux

2011-08-10 Thread Jonas Maebe
On 10 Aug 2011, at 14:24, Max Vlasov wrote: On Wed, Aug 10, 2011 at 1:18 PM, Max Vlasov max.vla...@gmail.com wrote: I tried to implement linux timer with timer_create and signals, but an exception always fired (External:SIGUSR1). Hmm, it seems that it's not a 'wrong' exception, I

Re: [fpc-pascal] Re: timer_create on linux

2011-08-10 Thread Jonas Maebe
On 10 Aug 2011, at 15:32, Max Vlasov wrote: On Wed, Aug 10, 2011 at 4:34 PM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: Can I somehow tell it to ignore some, for example 'SIG35'? I tried to add it to Language exceptions ignore list as 'External: SIG35', 'External:SIG35' (without space

Re: [fpc-pascal] Re: timer_create on linux

2011-08-10 Thread Jonas Maebe
On 10 Aug 2011, at 16:12, Max Vlasov wrote: SIG35 behaves the same. Strangely, I looked in system monitor for gdb command-line, it looked ok /usr/bin/gdb -silent -i mi -nx --eval-command=handle SIG35 nostop noprint pass but after the same Initialization output dialog it still stops with

Re: [fpc-pascal] Where's my OSX window dressing?

2011-08-11 Thread Jonas Maebe
On 11 Aug 2011, at 08:23, Bruce Tulloch wrote: What puzzles me is that OSX allows an application to appear such that its title bar is hidden by the desktop menu bar but does not seem to provide an easy way to then relocate the window to a new position. I'm clearly a Mac newbie, what am I

Re: [fpc-pascal] Working Free Pascal android JNI example

2011-08-11 Thread Jonas Maebe
On 11 Aug 2011, at 11:56, Felipe Monteiro de Carvalho wrote: On Wed, Aug 10, 2011 at 12:41 PM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: No, hacks like that do not belong in trunk. And about release branches then? Are hacks allowed to be merged directly to release branches

Re: [fpc-pascal] Should Lazarus and FPC release library updates separately from product updates?

2011-08-12 Thread Jonas Maebe
On 12 Aug 2011, at 13:04, Frank Church wrote: Unless library updates don't depend on product updates shouldn't they be kept separate? I don't know if it is something already done that is not explained well enough or is not done at all? It is not done at all for FPC. The reason is that

Re: [fpc-pascal] Using array of xxx in function call, Delphi compatibility

2011-08-13 Thread Jonas Maebe
On 13 Aug 2011, at 12:28, Juha Manninen wrote: TMainMenu.Items is of type TMenuItem. TMenuItem has only one version of Add method and it takes another TMenuItem as parameter (checked from VCL source). Still, to my surprise, the code works in Delphi. FPC says: Error: Incompatible type for

Re: [fpc-pascal] Using array of xxx in function call, Delphi compatibility

2011-08-13 Thread Jonas Maebe
On 13 Aug 2011, at 18:17, Sven Barth wrote: Related question, but the other way round. The following code does compile in FPC (didn't test Delphi). Is that by design? [snip passing single element to open array parameter] Yes. It also works in TP/Delphi.

Re: RE : [fpc-pascal] Is such memory statistics possible?

2011-08-15 Thread Jonas Maebe
On 15 Aug 2011, at 12:03, Ludo Brands wrote: 100.00% (288,964,608B) (page allocation syscalls) mmap/mremap/brk, --alloc-fns, etc. -37.20% (107,483,136B) 0x80C7DD3: SYSTEM_FPSYSCALL$LONGINT$LONGINT$$LONGINT (in /home/ludo/lazarus/lazarus) | -37.20% (107,483,136B) 0x80C86DF:

Re: [fpc-pascal] Redirecting heap trace output to stdout

2011-08-17 Thread Jonas Maebe
On 17 Aug 2011, at 18:37, leledumbo wrote: Therefore, I'd like to redirect it to stderr, but I have no idea how... assign(stderr,'somefile'); rewrite(stderr); Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Virtual inline methods

2011-08-18 Thread Jonas Maebe
On 18 Aug 2011, at 17:08, dhkblas...@zeelandnet.nl dhkblas...@zeelandnet.nl wrote: I'm porting a piece of code from C++ and there they use virtual inline methods. I tried it in FPC but it accepts either virtual OR inline methods. Is this a bug, or a feature that I don't understand enough

Re: [fpc-pascal] FPC i386 and x86_64 using the same source

2011-08-22 Thread Jonas Maebe
On 22 Aug 2011, at 22:51, Marcos Douglas wrote: In my opinion, everything that was created should have a prefix folder specifying your TARGET. If I compile the FPC to x64 plataform all these binaries only will run on this platform. I want to have each file/exe/ppu/etc for each platform.

Re: [fpc-pascal] FPC i386 and x86_64 using the same source

2011-08-22 Thread Jonas Maebe
On 22 Aug 2011, at 23:08, Marcos Douglas wrote: On Mon, Aug 22, 2011 at 5:59 PM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: On 22 Aug 2011, at 22:51, Marcos Douglas wrote: In my opinion, everything that was created should have a prefix folder specifying your TARGET. If I compile

Re: [fpc-pascal] FPC i386 and x86_64 using the same source

2011-08-23 Thread Jonas Maebe
On 23 Aug 2011, at 08:46, Graeme Geldenhuys wrote: I just searched all my PDF docs for FPC, and couldn't find a single reference to 'crossinstall' anywhere. :-( The FPC documentation does not document building FPC itself, that is what the buildfaq is for (although apparently it doesn't

Re: [fpc-pascal] New Dispose and FreeMem and objects

2011-08-26 Thread Jonas Maebe
On 26 Aug 2011, at 22:39, Andrew Haines wrote: Maybe Dispose can call a destructor and that is the difference between Dispose and FreeMem? The other difference is that dispose() will finalize any reference counted fields, while freemem won't.

Re: [fpc-pascal] FP IDE - jump to implementation

2011-08-26 Thread Jonas Maebe
On 26 Aug 2011, at 23:56, Graeme Geldenhuys wrote: Is there a keyboard shortcut for FP IDE (text IDE included with FPC) to jump from the interface section to the implementation section of a method. No. As far as I know, it does not have any functionality to parse the structure of the source

Re: [fpc-pascal] New Dispose and FreeMem and objects

2011-08-26 Thread Jonas Maebe
On 27 Aug 2011, at 00:18, Andrew Haines wrote: Ok so freemem is okay as long as I am careful about the members of the object. There may be other problems I'm not thinking of right now. I don't understand why you want to use freemem for objects, since the only difference with dispose is that

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-09 Thread Jonas Maebe
On 09 Sep 2011, at 13:40, Marco van de Voort wrote: In our previous episode, michael.vancann...@wisa.be said: You must remove the quotes around 'outputfile.org': Status:=ExecuteProcess('/path/to/oggenc',['-Q','-- output=outputfile.org','tempfile.wav']); While better, this is afaik not

Re: [fpc-pascal] Overloading the increment operator (+=)

2011-09-11 Thread Jonas Maebe
On 10 Sep 2011, at 22:32, Flávio Etrusco wrote: Does FPC allow overloading the += operator? If not, why? It is translated into x:=x+y at the parser level, and overload resolving happens later. So once you overload + (and := if required), += should also work. Jonas

Re: [fpc-pascal] WinCE multithreading

2011-09-14 Thread Jonas Maebe
On 14 Sep 2011, at 19:16, Fabio Luis Girardi wrote: I'm debugging and I have doubt: I'm using records and pointers to records. On WinCE wiki, the use of unaligned only shows with pointers to integer. And with recods, I must do unalinged(myrec^).member or unalinged(myrec^.member) If

Re: [fpc-pascal] Interface, _AddRef, _Release, etc.

2011-09-15 Thread Jonas Maebe
On 14 Sep 2011, at 23:17, Marcos Douglas wrote: BUT, if I create my TFoo without refcount should works, right? Only in some circumstances. These circumstances depend on when the compiler allocates temporary interface instances, and when these are finalized. ... but, does not work. In

Re: [fpc-pascal] Interface, _AddRef, _Release, etc.

2011-09-16 Thread Jonas Maebe
On 16 Sep 2011, at 09:02, Graeme Geldenhuys wrote: Should that example not mention that it will not work with any released FPC version to date? No. That example will only work with the still to be released 2.6.0 and later. Why Because current released FPC versions don't support the

Re: [fpc-pascal] Pascal for osx Lion

2011-09-28 Thread Jonas Maebe
On 27 Sep 2011, at 22:34, Murray Whittington wrote: I downloaded free pascal for mac osx and I discovered that it wont run on OSX Lion :( as Apple has removed X11 and other modules etc out of lion so basically have to go back to snow leopard to make it work, but I have Lion installed.

Re: [fpc-pascal] Syntax error with new FPC SVN

2011-09-30 Thread Jonas Maebe
On 30 Sep 2011, at 16:56, fred f wrote: I have updated my FPC to SVN from today and when I try to compile my old code working with 2.5.1 from June writes: TYPE TByteSet = set of Byte(0)..Byte(7); Fatal: Syntax error, ; expected but ( found What has changed on syntax for this definition?

Re: [fpc-pascal] Syntax error with new FPC SVN

2011-09-30 Thread Jonas Maebe
On 30 Sep 2011, at 18:27, Paul Ishenin wrote: This is probably my fault although: 1. delphi does not support such declarations 2. we don't have a test for this kind of syntax So maybe we had a feature by accident? Set type is defined as set of ordinal type:

Re: [fpc-pascal] FPC 2.4.4 - Error: Illegal type conversion: Set of TMySet to Byte ... and vice versa

2011-10-13 Thread Jonas Maebe
On 13 Oct 2011, at 11:42, fred f wrote: I am trying to compile my code which is compatible with Delphi and FPC 2.5.1+, but when I try to compile on Mac OS X with 2.4.4 I have error message: Error: Illegal type conversion: Set of TMyEnum to Byte It works in FPC 2.5.1+ because of this change:

Re: [fpc-pascal] How do I load external Pascal code?

2011-10-13 Thread Jonas Maebe
On 13 Oct 2011, at 20:36, Andrew Pennebaker wrote: If I were using C, I would type: #include code.h If I were using Python, I would type: import code What's the command to load code in Pascal? http://www.learn-programming.za.net/programming_pascal_learn12.html Jonas

Re: [fpc-pascal] How do I load external Pascal code?

2011-10-13 Thread Jonas Maebe
On 13 Oct 2011, at 21:37, Andrew Pennebaker wrote: Is it possible to have a begin/end declaration in a unit a la C's main function? I would like my units to double as libraries and executables. Yes: http://www.freepascal.org/docs-html/ref/refse72.html Jonas

Re: [fpc-pascal] Any command line interpreters for Free Pascal?

2011-10-15 Thread Jonas Maebe
On 15 Oct 2011, at 17:24, Andrew Pennebaker wrote: Good idea, van de Voort. Can someone confirm that fpc plays nicely with shebangs in a version after 2.4.4? It doesn't. Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Any command line interpreters for Free Pascal?

2011-10-16 Thread Jonas Maebe
On 16 Oct 2011, at 11:42, Jürgen Hestermann wrote: But hiding away the compilation step from the user does not turn a compiler language into an interpreter language. There is no benefit in doing so. You can simply compile your programs and then use the executable in your scripts. Where is

Re: [fpc-pascal] How can I implement thrice in Free Pascal?

2011-10-18 Thread Jonas Maebe
On 18 Oct 2011, at 20:03, Andrew Pennebaker wrote: In particular, if anyone knows a way to implement a general concatenation function Concat(Arr1, Arr2), let me know. I'm under the impression that you are trying to program in a statically typed language the same way as you'd use a

Re: [fpc-pascal] How can I implement thrice in Free Pascal?

2011-10-19 Thread Jonas Maebe
On 19 Oct 2011, at 09:59, Marco van de Voort wrote: In our previous episode, Sven Barth said: This implementation will result in crashes if T is a reference- counted type. Right... I tend to forget about these... what would the correct way to copy an array of ref counted types? E.g. an

Re: [fpc-pascal] Why do string indices start at 1, but array indices start at 0?

2011-10-21 Thread Jonas Maebe
On 21 Oct 2011, at 08:25, Roberto P. wrote: During compilation, by statically checking the indices used to access the string, the compiler could fire a warning (or error?) if a string[0] is found. The compiler already does that (except for shortstrings, where string[0] is valid). Jonas

Re: [fpc-pascal] text.inc(1955, 20) Error: identifier idents no member CodePage

2011-10-26 Thread Jonas Maebe
On 26 Oct 2011, at 13:47, Marcos Douglas wrote: I got this error when I tried to compile FPC 2.7.1 rev 19546. - W:/md/dev/freepascal/binutils/ppc386.2_6.exe -Ur -Xs -O2 -n -Fi../ inc -Fi../i386

Re: [fpc-pascal] text.inc(1955, 20) Error: identifier idents no member CodePage

2011-10-26 Thread Jonas Maebe
On 26 Oct 2011, at 14:25, Graeme Geldenhuys wrote: Maybe the makefile can be amended to check the version number of the FPC being used. If you are trying to compile Trunk, and the FPC version you want to use is not the last known released version, give a error indicating the problem, and

Re: [fpc-pascal] text.inc(1955, 20) Error: identifier idents no member CodePage

2011-10-26 Thread Jonas Maebe
On 26 Oct 2011, at 14:44, Marcos Douglas wrote: Hm... thinking better you're right. You're the man, the real developer, so... is boring answer these mails, I know, but I really want to help the community! I'm not saying: Solve my problem!! you know... I use the stable version. The trunk is

Re: [fpc-pascal] text.inc(1955, 20) Error: identifier idents no member CodePage

2011-10-26 Thread Jonas Maebe
On 26 Oct 2011, at 15:04, Martin wrote: On 26/10/2011 13:58, Jonas Maebe wrote: What is boring is not helping people that have problems, but answering exactly the same question over and over again (although the fact that the same question keeps being asked obviously means that just

Re: [fpc-pascal] text.inc(1955, 20) Error: identifier idents no member CodePage

2011-10-26 Thread Jonas Maebe
On 26 Oct 2011, at 15:28, Martin wrote: To build trunk (or any revision) with a starting compiler, that is itself the same revision = I would expect that to work always? Yes, but there is no way to encode such an exception in the Makefile without requiring a bunch of svn-related

Re: [fpc-pascal] How can I implement thrice in Free Pascal?

2011-10-31 Thread Jonas Maebe
On 31 Oct 2011, at 08:36, Andrew Pennebaker wrote: I forcibly sudo cp ppc386 /usr/local/bin/fpc, mitigating the issue. Yeah, something in the makefile installation process is definitely moving over an older version. Create a symlink from /usr/local/bin/ppc386 to

Re: [fpc-pascal] A linking error when compiling with FPC 2.4.4

2011-10-31 Thread Jonas Maebe
On 31 Oct 2011, at 11:27, Luciano de Souza wrote: The executable was not generated. In its place, I found link.res. The compilation was successful, but for a unknown reason, the linkage was not completed. I don't understand what the statements in link.res means indeed. In spite of the

Re: [fpc-pascal] A linking error when compiling with FPC 2.4.4

2011-10-31 Thread Jonas Maebe
On 31 Oct 2011, at 12:10, Michael Van Canneyt wrote: On Mon, 31 Oct 2011, Jonas Maebe wrote: sqlite3 is not part of FPC. You probably have to install the sqlite3-dev package or something like that. Arguably, that should be a dependency of the fpc .deb package that installs support

Re: [fpc-pascal] How can I implement thrice in Free Pascal?

2011-10-31 Thread Jonas Maebe
On 31 Oct 2011, at 18:29, Andrew Pennebaker wrote: Jonas, make install does, however, overwrite /usr/local/bin/fpc, which is not a symlink, with an old version during install. Try running fpc -version halfway and after make install. The fpc binary does not have a version number. It reports

Re: [fpc-pascal] EnumToString

2011-11-01 Thread Jonas Maebe
On 01 Nov 2011, at 10:30, Juha Manninen wrote: WriteStr (S, N); Thanks guys! WriteStr() was the function I was looking for. You can also use the plain str() procedure. Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] March 2025? :o

2011-11-02 Thread Jonas Maebe
On 02 Nov 2011, at 20:34, silvioprog wrote: I have accessed the link http://lists.freepascal.org/lists/fpc-pascal/; to read old entries. And I saw that the last date is 2025 That's what happens when someone sends a mail while their system clock is set such a date in the future.

Re: [fpc-pascal] Re: Free Pascal 2.6.0rc1 released

2011-11-05 Thread Jonas Maebe
On 06 Nov 2011, at 02:32, Seth Grover wrote: A couple of questions: where can this be found in svn? I don't see a tag for it, and fixes_2_6 hasn't been modified for 8 weeks or so. http://svn.freepascal.org/svn/fpc/tags/release_2_6_0_rc1/ Jonas ___

Re: [fpc-pascal] Free Pascal 2.6.0rc1 released

2011-11-06 Thread Jonas Maebe
On 06 Nov 2011, at 11:56, Tommi Prami wrote: On 6.11.2011 1:27, Marco van de Voort wrote: Details about these new features can be found at http://wiki.freepascal.org/FPC_New_Features_2.6.0 Seems that Freepascal Wiki is not available. If someone can access it post the information on

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-06 Thread Jonas Maebe
On 06 Nov 2011, at 15:13, dmitry boyarintsev wrote: Hi-jacking, the thread, and again should FPC chase Delphi forever? If we want to offer compatibility with source code written for Delphi, which does happen to be one of FPC's project goals, then yes, we do have to do that to some extent.

Re: [fpc-pascal] What is the difference between the declarations at the beginning of a class and those declared in the public section?

2011-11-06 Thread Jonas Maebe
On 06 Nov 2011, at 15:34, Frank Church wrote: What is the difference between field declarations at the beginning of a class and those declared in the public section? There is no the public section. You can declare as many public (and private, and ...) sections as you want. They are all

Re: [fpc-pascal] What is the difference between the declarations at the beginning of a class and those declared in the public section?

2011-11-06 Thread Jonas Maebe
On 06 Nov 2011, at 19:26, Frank Church wrote: So it means that unless a field or method is in the private or protected section or published, strict private or strict protected section it is automatically public? Yes (or published in case of {$m+}, as Michael added). Jonas

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-06 Thread Jonas Maebe
On 06 Nov 2011, at 19:21, Jürgen Hestermann wrote: Florian Klämpfl schrieb: I have the same feeling as Dmitry: There must be a time when FPC does not run after Delphi. Why not now? Feel free to start a fork and we will see what will make it into trunk. Sorry, but I don't know what you

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-07 Thread Jonas Maebe
On 07 Nov 2011, at 08:10, Martin Schreiber wrote: I don't understand why FPC should become a 100% Delphi clone instead the best general software development environment ever for the only purpose that Delphi users have a free cross platform alternative without to care about FPC

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-07 Thread Jonas Maebe
On 07 Nov 2011, at 11:28, Martin Schreiber wrote: On Monday 07 November 2011 10.55:41 Jonas Maebe wrote: On 07 Nov 2011, at 08:10, Martin Schreiber wrote: One reason is to make it easy for FPC users to reuse existing Delphi code that is out there without having to rewrite it in an FPC

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-07 Thread Jonas Maebe
On 07 Nov 2011, at 18:45, Jürgen Hestermann wrote: Jonas Maebe schrieb: That's exactly what he said: you are free to create a fork (= take the FPC source code and do whatever you want with it), and then the currently active FPC developers are also free to take whichever of your patches

Re: [fpc-pascal] Generics vs TCollection

2011-11-08 Thread Jonas Maebe
On 08 Nov 2011, at 10:55, Graeme Geldenhuys wrote: I was reviewing some old code that used TCollection TCollectionItem descendants. This made me think... With the introduction of Generics, is there really still a need for TCollection/TCollectionItem? At the very least, backward

Re: [fpc-pascal] Free Pascal 2.6.0rc1 released

2011-11-08 Thread Jonas Maebe
On 07 Nov 2011, at 23:27, Peter wrote: Does this release include intrinsic ROL ROR? 'Bug' 6300 is shown as fixed, but I can find no mention in the new features list. http://bugs.freepascal.org/view.php?id=6300 I've added it to the wiki page. Jonas

Re: [fpc-pascal] parent class as a parameter type

2011-11-14 Thread Jonas Maebe
On 12 Nov 2011, at 22:18, ik wrote: Since 2.6.0, when you write something like this: procedure foo(AClass : TStrings); foo(MyStringList); // Will return an error that TStrings is expected ... Are you certain there is no var or out in front of that parameter? I can not use TStringList as

Re: [fpc-pascal] Re: pchar with more than 255 characters

2011-11-14 Thread Jonas Maebe
On 13 Nov 2011, at 14:02, Rainer Stratmann wrote: Am Sunday 13 November 2011 02:15:07 schrieb leledumbo: It works when {$LONGSTRINGS ON} or {$H+} directive exists. I think the compiler treats functions receiving array of char (or pointer to it) as ShortString when none of the directives

Re: [fpc-pascal] parent class as a parameter type

2011-11-14 Thread Jonas Maebe
On 13 Nov 2011, at 17:56, Graeme Geldenhuys wrote: On 12/11/2011, ik idokan@ wrote: procedure foo(AClass : TStrings); foo(MyStringList); // Will return an error that TStrings is expected ... I can not use TStringList as the parameter without casting it to TStrings. But I do not

Re: [fpc-pascal] pchar with more than 255 characters

2011-11-15 Thread Jonas Maebe
On 14 Nov 2011, at 22:08, Felipe Monteiro de Carvalho wrote: On Sun, Nov 13, 2011 at 1:39 AM, Rainer Stratmann rainerstratm...@t-online.de wrote: procedure getchars( p : pchar ); var l : longint; begin l := length( p ); end; You cannot do length in a PChar length(pchar) is translated

Re: [fpc-pascal] Re: pchar with more than 255 characters

2011-11-16 Thread Jonas Maebe
On 16 Nov 2011, at 17:06, Martin wrote: So why not use pos(#0, foo_pchar) ? That will convert foo_pchar to a string type (which one probably depends on the state of the {$h} switch) and then call pos() on it. Again: length(pchar) is perfectly correct and will be translated into

Re: [fpc-pascal] Re: pchar with more than 255 characters

2011-11-16 Thread Jonas Maebe
On 16 Nov 2011, at 17:15, Sven Barth wrote: Am 16.11.2011 16:55, schrieb Rainer Stratmann: But when having pchar I wonder why it generally is not possible to make strings longer than 255 as it was possible in the previous compiler version. There was never a change regarding this as far

Re: [fpc-pascal] pchar with more than 255 characters

2011-11-16 Thread Jonas Maebe
On 16 Nov 2011, at 17:15, Felipe Monteiro de Carvalho wrote: On Tue, Nov 15, 2011 at 11:33 AM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: length(pchar) is translated into strlen(pchar) (just like in Delphi). But why is it limited to 255 chars in {$H-} ? It is not. (I understood

Re: [fpc-pascal] Compilation error in crosscompiling lNet to arm-linux

2011-11-20 Thread Jonas Maebe
On 20 Nov 2011, at 21:30, Torsten Bonde Christiansen wrote: I get the following error when crosscompiling lNet to arm-linux. $ fpc -MObjFPC -Sgim -CX -O2 -Parm -gs -gl -vew -l -Fi../lib/sys -Fu../lib -Fu. -FUlib/arm-linux/ -dLNET_BASE -fPIC lnetbase.pas Free Pascal Compiler version 2.4.4

Re: [fpc-pascal] Compilation error in crosscompiling lNet to arm-linux

2011-11-20 Thread Jonas Maebe
On 20 Nov 2011, at 21:41, Torsten Bonde Christiansen wrote: On 2011-11-20 21:36, Jonas Maebe wrote: It's a missing feature. The problem is that you are trying to generate PIC ARM code, which is not yet implemented/supported. Is it going to be in 2.6. Perhaps in trunk? It's

Re: [fpc-pascal] Class reference doubt

2011-11-23 Thread Jonas Maebe
On 23 Nov 2011, at 22:48, Jesus Reyes wrote: in the following example The output is: cls class is TFoo TObj.create where I would expect: cls class is TFoo TObj.create TFoo.create ie the TFoo.constructor is not called, is this normal/expected? Yes. You have to use a virtual

Re: [fpc-pascal] Generic syntax that compiles with FPC 2.4.4 but not with FPC 2.6.0-0.rc1

2011-11-23 Thread Jonas Maebe
On 23 Nov 2011, at 23:01, Juha Manninen wrote: The following does not compile any more with FPC 2.6.0-0.rc1. --- generic TGen_T = class type public T_TArray = array of _T; var private w: T_TArray; public constructor Create(Value: _T); end; TSpecial =

Re: [fpc-pascal] Class reference doubt

2011-11-24 Thread Jonas Maebe
On 24 Nov 2011, at 02:58, Luiz Americo Pereira Camara wrote: On 23/11/2011 18:48, Jesus Reyes wrote: in the following example The output is: cls class is TFoo TObj.create where I would expect: cls class is TFoo TObj.create TFoo.create I also hit this problem recently Found that this is

Re: [fpc-pascal] Free Pascal 2.6.0rc1 released

2011-11-24 Thread Jonas Maebe
On 24 Nov 2011, at 10:46, Bernd wrote: The branch fixes_2_6 still has the version 2.5.1. shouldn't this be set to 2.6.0-RC1.1? No. Only releases have even version numbers (RC or not). Branches are only updated to the next version number (in this case, that will be 2.6.1) once the

Re: [fpc-pascal] Free Pascal 2.6.0rc1 released

2011-11-24 Thread Jonas Maebe
On 24 Nov 2011, at 12:06, Rainer Stratmann wrote: Isn't it possible to put all processors in the compiler. In theory, that would be possible with lots of rewriting. In practice there is little or no reason to spend time on that. You can always use fpc -Pi386 and fpc -Parm to call the

Re: [fpc-pascal] Heap, Stack, HeapTrc and threads

2011-11-24 Thread Jonas Maebe
On 24 Nov 2011, at 16:28, andrew.benn...@ns.sympatico.ca andrew.benn...@ns.sympatico.ca wrote: At no point did the heap status reveal the growing amount of space tied up: the only odd thing was that TotalAllocated sometimes came back negative in the threads as the program approached the

Re: [fpc-pascal] Free Pascal 2.6.0rc1 released

2011-11-24 Thread Jonas Maebe
On 24 Nov 2011, at 18:14, Bernd wrote: Yes, I understand the intention. But this leads to the dilemma that now the branch which is by definition always same or more advanced than the last release(candidate) from it still has a *lower* version number than the already released release

Re: [fpc-pascal] Class reference doubt

2011-11-24 Thread Jonas Maebe
On 24 Nov 2011, at 23:00, Luiz Americo Pereira Camara wrote: On 24/11/2011 08:02, Jonas Maebe wrote: On 24 Nov 2011, at 02:58, Luiz Americo Pereira Camara wrote: On 23/11/2011 18:48, Jesus Reyes wrote: where I would expect: cls class is TFoo TObj.create TFoo.create I also hit

Re: [fpc-pascal] Heap, Stack, HeapTrc and threads

2011-11-25 Thread Jonas Maebe
On 25 Nov 2011, at 08:43, Marco van de Voort wrote: IMHO if you get into trouble with this, you are already walking on the edge of the abyss. Using cmem (or any other advanced memory manager) might give short time relieve because it probably has a different allocation pattern. Not

Re: [fpc-pascal] The strange case of arm-linux-ld: skipping incompatible

2011-11-26 Thread Jonas Maebe
On 26 Nov 2011, at 09:05, Felipe Monteiro de Carvalho wrote: arm-linux-ld seams to have a fixed idea about where to find libc No, FPC has that fixed idea. Use the -Xd command line option to make the compiler/linker skip searching the default directories for libraries and object files.

Re: [fpc-pascal] WriteStr and int-range types (eg TColor)

2011-11-26 Thread Jonas Maebe
On 26 Nov 2011, at 16:10, Martin wrote: I know WriteStr can be used to get the names of enum: WriteStr(s, enumOne) Plain Str also works: Str(enumOne,s). But should/could it also work on sub-range types of int? Like TGraphicsColor = -$7FFF-1..$7FFF; or even TFoo = type integer;

Re: [fpc-pascal] i386: strange code generated in simple for loop

2011-12-03 Thread Jonas Maebe
On 03 Dec 2011, at 21:41, Bernd wrote: Hello, I have observed something I do not understand. The following is a series of for-loops and the generated code looks strange to me. There always appears an inc followed by a dec Note that the inc comes before the loop body and the dec is inside it.

Re: [fpc-pascal] range check error while evaluating constant (number literals larger than$7fffffffffffffff)

2011-12-05 Thread Jonas Maebe
On 06 Dec 2011, at 00:39, Bernd wrote: var x : QWord; begin x := $; writeln(IntToHex(x, 16)); end. All constants $ are always parsed as int64. You have to explicitly typecast them to qword() if you want the compiler to treat them that way.

Re: [fpc-pascal] Why is Random(255) some 529x slower compared to Delphi 7?

2011-12-07 Thread Jonas Maebe
On 07 Dec 2011, at 13:51, michael.vancann...@wisa.be wrote: I think the random() algorithm is simply much more complicated in FPC. That's correct. We use the mersenne twister, Delphi probably a linear congruential generator. The mersenne twister has a much larger period. Jonas

Re: [fpc-pascal] Why is Random(255) some 529x slower compared to Delphi 7?

2011-12-09 Thread Jonas Maebe
On 09 Dec 2011, at 09:39, Graeme Geldenhuys wrote: Looking at the code again, I have no idea how it will affect the encryption algorithm if I move the assignment to RandSeed outside the loop It will improve the randomness of the generated numbers. Changing the random seed all the time

Re: [fpc-pascal] Readline substitute

2011-12-09 Thread Jonas Maebe
On 09 Dec 2011, at 19:37, nore...@z505.com wrote: See what happened to common lisp clisp when they used it. Had to change license to GPL even though they didn't want to. They changed the license because they didn't want to stop using GNU libreadline. If they had switched to a BSD-licensed

Re: [fpc-pascal] Shared libries

2011-12-11 Thread Jonas Maebe
On 11 Dec 2011, at 23:18, Torsten Bonde Christiansen wrote: So in the following example foo would not be visible (neither as foo nor bar) to other program (eg. a C-program) unless I added an *exports* section? Correct. See also

Re: [fpc-pascal] Shared libries

2011-12-11 Thread Jonas Maebe
On 12 Dec 2011, at 00:48, nore...@z505.com wrote: In newer versions of FPC it allows you to put an exports clause in the unit itself, but older versions didn't allow it. http://bugs.freepascal.org/bug_view_page.php?bug_id=4398history=1 That functionality is buggy and cannot be used safely

Re: [fpc-pascal] Shared libries

2011-12-12 Thread Jonas Maebe
On 12 Dec 2011, at 19:56, nore...@z505.com wrote: procedure proc1; stdcall; begin writeln('hello'); end; exports proc1; procedure proc2; stdcall; begin writeln('hello 2'); end; exports proc2; end. Notice how I put exports in several places... It works on win32.. It only

Re: [fpc-pascal] Shared libries

2011-12-12 Thread Jonas Maebe
On 12 Dec 2011, at 20:17, Torsten Bonde Christiansen wrote: On 2011-12-12 20:04, Jonas Maebe wrote: It only partially works. Please see the bug report I mentioned earlier: http://bugs.freepascal.org/bug_view_advanced_page.php?bug_id=16070 Does this just mean I have to compile my library

Re: [fpc-pascal] nostackframe -- possible to create faulty code?

2011-12-13 Thread Jonas Maebe
On 13 Dec 2011, at 15:42, Bernd wrote: Is it thoretically possible to make an otherwise perfectly working program crash with access violation only because I used the nostackframe modifier on a nested procedure? Yes. See also http://bugs.freepascal.org/bug_view_advanced_page.php?bug_id=15527

Re: [fpc-pascal] Re: PPU checksum issue

2011-12-13 Thread Jonas Maebe
On 13 Dec 2011, at 22:08, ik wrote: A clean svn version of fpc 2.6.0 (rc), and Lazarus 0.9.31 r34161 FPC 2.5.1 x86_64-linux-gtk 2. It happens only on install all of the components. After clean all. I also tried to re-download lazarus from svn as a clean copy, again the same issue. You

Re: [fpc-pascal] Distributing unit object files

2011-12-15 Thread Jonas Maebe
On 15 Dec 2011, at 16:19, Andrew Brunner wrote: project has the source to. And FPC is looking to recompile the compiled object file because a CRC has changed for a contributing unit that was used when the unit object file was created. How do I make FPC not rebuild the unit object file when

Re: [fpc-pascal] inline and other modifiers

2011-12-16 Thread Jonas Maebe
On 16 Dec 2011, at 21:36, Bernd wrote: This seems to compile and work as intended, no matter which of the two implementations I choose. But I wonder how this can work? I always thought that what is written in the interface section is authoritative. How can the compiler properly use this unit

Re: [fpc-pascal] CPU registers and function calls, unclear explanation in the docs

2011-12-16 Thread Jonas Maebe
On 17 Dec 2011, at 01:46, Bernd wrote: Is there maybe any other document somewhere that describes what *exactly* is expected by the compiler to happen with the registers during a function call or maybe somebody can show me where in the FPC sources I have to look to see for myself what

Re: [fpc-pascal] CPU registers and function calls, unclear explanation in the docs

2011-12-16 Thread Jonas Maebe
On 17 Dec 2011, at 01:59, Jonas Maebe wrote: On 17 Dec 2011, at 01:46, Bernd wrote: Is there maybe any other document somewhere that describes what *exactly* is expected by the compiler to happen with the registers during a function call or maybe somebody can show me where in the FPC

Re: [fpc-pascal] Re: Generics and Mac

2011-12-17 Thread Jonas Maebe
On 17 Dec 2011, at 18:22, Juha Manninen wrote: Fatal: Syntax error, expected but CLASS found Works on 64-bit Linux. How can OSX affect generics syntax? There are no Mac OS X-specific failures of generics tests in the testsuite (64 bit or otherwise, Intel or PowerPC). There are no bug

Re: [fpc-pascal] Memory leak

2011-12-18 Thread Jonas Maebe
On 18 Dec 2011, at 14:04, dhkblas...@zeelandnet.nl wrote: mytest^.name := Format('%s.%.3d', ['name', 1]); This assigns 'name.001' to the pointer variable but causes a memleak. If I assign the same value as string constant no memleak occurs, so it must be something related to format.

Re: [fpc-pascal] Memory leak

2011-12-18 Thread Jonas Maebe
On 18 Dec 2011, at 15:45, dhkblas...@zeelandnet.nl wrote: It was an ansistring indeed, and finalize did the trick! Thanks for your help. How does New and Dispose work btw? Do they use RTTI to call finalize appropriatly? Yes. I tried searching the New and Dispose implementations in the

  1   2   3   4   5   6   7   8   9   10   >