[fpc-pascal] GDB for 64 bit Windows ?
Hi, i have build a native ppcx64 in windows 7 64 bit. But i can't find a 64 bit version of GDB in http://svn.freepascal.org/svn/fpcbuild/trunk/install/binw64. Is the 32 bit gdb in http://svn.freepascal.org/svn/fpcbuild/trunk/install/binw32 able to debug reliably a 64 bit process ? Or i must use the windows debugging tools ? regards, -- Dimitrios Chr. Ioannidis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] GDB for 64 bit Windows ?
Dimitrios Chr. Ioannidis schreef: Hi, Is the 32 bit gdb in http://svn.freepascal.org/svn/fpcbuild/trunk/install/binw32 able to debug reliably a 64 bit process ? AFAIK you cannot use the 32 bits version. You can download gdb for win64 from SF. A tested version (but not the latest version) with Lazarus is in http://svn2.freepascal.org/svn/lazarus/binaries/x86_64-win64/gdb/bin/ Vincent ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Compiler Warning: Constructor should be public
I've searched the list archives related to the subject of the fpc warning Constructor should be public and am unsure as to the resolution of this issue, or would perhaps like to revisit it. In my opinion the warning should be removed, or at least able to be suppress through a switch. I beginning to make the transition to cross platform delphi/pascal code. I have many times in the past used private or protected constructors to signify a class is should be created outside the unit in which it was defined. Example: type EAssertError = class(Exception) private FFileName: string; FLineNumber: Integer; constructor CreateFromLine(const Msg, FileName: string; LineNumber: Integer); public property FileName: string read FFileName; property LineNumber: Integer read FLineNumber; end; ... { EAssertError } constructor EAssertError.CreateFromLine(const Msg, FileName: string; LineNumber: Integer); begin inherited Create(Msg); FFileName := FileName; FLineNumber := LineNumber; end; ... procedure AssertErrorProc(const Msg, FileName: string; LineNumber: Integer; ErrorAddr: Pointer); begin raise EAssertError.CreateFromLine(Msg, FileName, LineNumber); end; ... intialization System.AssertErrorProc := @AssertErrorProc; ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Compiler Warning: Constructor should be public
On 10 Nov 2009, at 14:35, Anthony Walter wrote: In my opinion the warning should be removed, or at least able to be suppress through a switch. FPC 2.4.0 will include the ability to suppress individual messages. Use -vq to show the messages numbers, and -vmxxx to suppress a particular message. You can download 2.4.0 release candidate 1 from the link on our website's home page (the call for testing was sent to the fpc-devel mailing list). Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Compiler Warning: Constructor should be public
Anthony Walter wrote: In my opinion the warning should be removed, or at least able to be suppress through a switch. I beginning to make the transition to cross The compiler is 100% and I think it should actually raise an Error instead of a Warning. Your code is flawed. Object Pascal is quite clear regarding visibility rules. TObject has a Public constructor. You can only raise the visibility from there, not reduce visibility. Imagine how confusing it will be if you code was a library of some sorts and other developers had to use it. In a inherited class, you have public visibility to the constructor or some other method, and then suddenly in the descendant class the methods are hidden from the developer?? Not a good idea. You can try out the code and see what I mean. Even in Delphi you cannot reduce a methods visibility, only make it more visible. In your code you posted, you cannot hide the constructor (one of them will always be visible). And it will be like that for both Delphi and FPC no matter if you try and hide the constructor or not. The default TObject.Create constructor is *always* visible from Public onwards. But like Jonas said, in newer compiler versions you can hide compiler messages, but that doesn't change the flaw in your code. raise EAssertError.Create; is perfectly legal, and will by-pass whatever you intended in your CreateFromLine() constructor. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Compiler Warning: Constructor should be public
Your argument is flawed. Visibility rules apply to identifiers, not keywords. Create // identifier CreateFromLine // different identifier No visibility is being changed by introducing a *new* identifier raise EAssertError.Create(Msg); // still visible raise EAssertError.CreateFromLine(Msg, FileName, LineNumber); // not visible On Tue, Nov 10, 2009 at 8:56 AM, Graeme Geldenhuys gra...@mastermaths.co.za wrote: Anthony Walter wrote: In my opinion the warning should be removed, or at least able to be suppress through a switch. I beginning to make the transition to cross The compiler is 100% and I think it should actually raise an Error instead of a Warning. Your code is flawed. Object Pascal is quite clear regarding visibility rules. TObject has a Public constructor. You can only raise the visibility from there, not reduce visibility. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] h2pas truncates strings
Hallo I am trying to convert a .h to pascal with h2pas. The header file contains many declarations with lines of 400 characters or longer. h2pas creates the *.tmp.h file with all the code intact but the .pas file's lines are cut off at 256 characters. Is there an easy way around this problem, ie not manually changing the .h file? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] h2pas truncates strings
2009/11/10 Wimpie Nortje wimpienor...@gmail.com: Hallo I am trying to convert a .h to pascal with h2pas. The header file contains many declarations with lines of 400 characters or longer. h2pas creates the *.tmp.h file with all the code intact but the .pas file's lines are cut off at 256 characters. Is there an easy way around this problem, ie not manually changing the .h file? I guess patching h2pas for this is the right thing to do, but as a workaround you can always run `indent` over the h file first to chop the lines. Henry ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] h2pas truncates strings
Thanks, I will try that. Henry Vermaak wrote: 2009/11/10 Wimpie Nortje wimpienor...@gmail.com: Hallo I am trying to convert a .h to pascal with h2pas. The header file contains many declarations with lines of 400 characters or longer. h2pas creates the *.tmp.h file with all the code intact but the .pas file's lines are cut off at 256 characters. Is there an easy way around this problem, ie not manually changing the .h file? I guess patching h2pas for this is the right thing to do, but as a workaround you can always run `indent` over the h file first to chop the lines. Henry ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] h2pas truncates strings
Ok, I've tried indent and it doesn't do the job because the comments are also 400 chars long. I also tried to add {$H+} to the top of h2pas.pas but the solution is not that easy. If someone could give me a pointer of where to start, maybe I can try to fix it. For starters, what is the yacc and lex files for? Henry Vermaak wrote: 2009/11/10 Wimpie Nortje wimpienor...@gmail.com: Hallo I am trying to convert a .h to pascal with h2pas. The header file contains many declarations with lines of 400 characters or longer. h2pas creates the *.tmp.h file with all the code intact but the .pas file's lines are cut off at 256 characters. Is there an easy way around this problem, ie not manually changing the .h file? I guess patching h2pas for this is the right thing to do, but as a workaround you can always run `indent` over the h file first to chop the lines. Henry ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] h2pas truncates strings
2009/11/10 Wimpie Nortje wimpienor...@gmail.com: Ok, I've tried indent and it doesn't do the job because the comments are also 400 chars long. From indent man page: -ln, --line-lengthn Set maximum line length for non-comment lines to n. See BREAKING LONG LINES. -lcn, --comment-line-lengthn Set maximum line length for comment formatting to n. See COMMENTS. Henry ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] h2pas truncates strings
indent can only add or delete whitespace. Comments that start with // and extend beyond the -lcn limit are left alone. Henry Vermaak wrote: 2009/11/10 Wimpie Nortje wimpienor...@gmail.com: Ok, I've tried indent and it doesn't do the job because the comments are also 400 chars long. From indent man page: -ln, --line-lengthn Set maximum line length for non-comment lines to n. See BREAKING LONG LINES. -lcn, --comment-line-lengthn Set maximum line length for comment formatting to n. See COMMENTS. Henry ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Compiler Warning: Constructor should be public
- Original Message - From: Anthony Walter sys...@gmail.com To: grae...@opensoft.homeip.net; FPC-Pascal users discussions fpc-pascal@lists.freepascal.org Sent: Wednesday, November 11, 2009 1:07 AM Subject: Re: [fpc-pascal] Compiler Warning: Constructor should be public Your argument is flawed. Visibility rules apply to identifiers, not keywords. Create // identifier CreateFromLine // different identifier No visibility is being changed by introducing a *new* identifier raise EAssertError.Create(Msg); // still visible raise EAssertError.CreateFromLine(Msg, FileName, LineNumber); // not visible SNIP Hi Anthony, Sorry, but you are incorrect; Create is a method, not an identifier, and like all methods, it is affected by visibility rules (public, private, protected). cheers, Paul ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Compiler Warning: Constructor should be public
Sorry, Create is an identifier. constructor TSampleForm.Create(AOwner: TComponent); var Create: Integer; begin inherited; Create := Tag; Caption := IntToStr(Create); end; Aside from that, if you read you will see I used two identifiers ... one called Create and another called ... get this CreateFromLine. See that? It's a different identifier (it's not the same). Test it out yourself. if 'Create' = 'CreateFromLine' then ; // always evaluates to false As such, the compiler shouldn't issue a warning about constructors must be public. protected constructor CreateFromData(var Data); // there should not be a warning saying CreateFromData must be public It should however issue a waring when you try to alter the visbility of a method: private procedure FreeInstance; override; // warning or error here is expected On Tue, Nov 10, 2009 at 4:35 PM, Paul Nicholls paulfnicho...@gmail.com wrote: - Original Message - From: Anthony Walter sys...@gmail.com To: grae...@opensoft.homeip.net; FPC-Pascal users discussions fpc-pascal@lists.freepascal.org Sent: Wednesday, November 11, 2009 1:07 AM Subject: Re: [fpc-pascal] Compiler Warning: Constructor should be public Your argument is flawed. Visibility rules apply to identifiers, not keywords. Create // identifier CreateFromLine // different identifier No visibility is being changed by introducing a *new* identifier raise EAssertError.Create(Msg); // still visible raise EAssertError.CreateFromLine(Msg, FileName, LineNumber); // not visible SNIP Hi Anthony, Sorry, but you are incorrect; Create is a method, not an identifier, and like all methods, it is affected by visibility rules (public, private, protected). cheers, Paul ___ fpc-pascal maillist - fpc-pas...@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Any Way to catch endless loop in fpc in Wince?
Hi Is there a way (or a 3rd party component or a library) to catch an endless loop after x seconds in applications running on arm Wince? -- View this message in context: http://old.nabble.com/Any-Way-to-catch-endless-loop-in-fpc-in-Wince--tp26293620p26293620.html Sent from the Free Pascal - General mailing list archive at Nabble.com. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Compiler Warning: Constructor should be public
On Tue, Nov 10, 2009 at 10:56 AM, Graeme Geldenhuys gra...@mastermaths.co.za wrote: Anthony Walter wrote: In my opinion the warning should be removed, or at least able to be suppress through a switch. I beginning to make the transition to cross The compiler is 100% and I think it should actually raise an Error instead of a Warning. Your code is flawed. Object Pascal is quite clear regarding visibility rules. TObject has a Public constructor. You can only raise the visibility from there, not reduce visibility. (...) raise EAssertError.Create; is perfectly legal, and will by-pass whatever you intended in your CreateFromLine() constructor. Graeme, I guess the OP didn't want to reintroduce the 'Create' constructor with lower visibility, just implement a second constructor with private visiblity. It can be useful when implementing singletons and factories to avoid some types of misuse by an unattentive coworker... IIRC the last time this issue was raised you were on the side for removing the warning - my opinion too ;-) -Flávio ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Compiler Warning: Constructor should be public
QFT, Flávio said: Graeme, I guess the OP didn't want to reintroduce the 'Create' constructor with lower visibility, just implement a second constructor (** with a different name **) with private visiblity. It can be useful when implementing singletons and factories to avoid some types of misuse by an unattentive coworker... IIRC the last time this issue was raised you were on the side for removing the warning - my opinion too ;-) Yes! And well put. *Thank you* 2009/11/10 Flávio Etrusco flavio.etru...@gmail.com: On Tue, Nov 10, 2009 at 10:56 AM, Graeme Geldenhuys gra...@mastermaths.co.za wrote: Anthony Walter wrote: In my opinion the warning should be removed, or at least able to be suppress through a switch. I beginning to make the transition to cross The compiler is 100% and I think it should actually raise an Error instead of a Warning. Your code is flawed. Object Pascal is quite clear regarding visibility rules. TObject has a Public constructor. You can only raise the visibility from there, not reduce visibility. (...) raise EAssertError.Create; is perfectly legal, and will by-pass whatever you intended in your CreateFromLine() constructor. Graeme, I guess the OP didn't want to reintroduce the 'Create' constructor with lower visibility, just implement a second constructor with private visiblity. It can be useful when implementing singletons and factories to avoid some types of misuse by an unattentive coworker... IIRC the last time this issue was raised you were on the side for removing the warning - my opinion too ;-) -Flávio ___ fpc-pascal maillist - fpc-pas...@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal