[fpc-pascal] reporting bugs? ... fpc 1.9.4 crash

2004-11-20 Thread David Emerson
Is there a better place to post bugs, outside the list?


Well, regardless, here it is...

fpc 1.9.4 crashes with the following source. Of course, my bug was easy enough 
to find/fix, but it looks bad when the compiler crashes! Not a bug in 1.0.10.

Synopsis: index variable "ix" has not been declared. Try to access an array 
element via this index, and write said element to a file.


var
   array_of_longint : array [0..5] of longint;
   longint_file : file of longint;

begin
   for ix := 0 to 5 do
  write (longint_file, array_of_longint[ix]);   // line 7
end.



Free Pascal Compiler version 1.9.4 [2004/05/30] for i386
Copyright (c) 1993-2004 by Florian Klaempfl
Target OS: Win32 for i386
Compiling test.pas
test.pas(6,6) Error: Identifier not found "ix"
test.pas(7,41) Error: Identifier not found "ix"
Compilation aborted test.pas:7
Runtime error 216 at $00472D7B
  $00472D7B
  $00474F32
  $004C95E0
  $004C96A1
  $0046B074
  $0046A501
  $0046C445
  $0046C456
  $0046C456
  $0046C456



___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] reporting bugs? ... fpc 1.9.4 crash

2004-11-20 Thread Paul Davidson
If you are in TB or DELPHI mode, then IX may be defined as a CPU 
register

On Nov 20, 2004, at 15:30, David Emerson wrote:
Is there a better place to post bugs, outside the list?
Well, regardless, here it is...
fpc 1.9.4 crashes with the following source. Of course, my bug was 
easy enough to find/fix, but it looks bad when the compiler crashes! 
Not a bug in 1.0.10.

Synopsis: index variable "ix" has not been declared. Try to access an 
array element via this index, and write said element to a file.

var
   array_of_longint : array [0..5] of longint;
   longint_file : file of longint;
begin
   for ix := 0 to 5 do
  write (longint_file, array_of_longint[ix]);   // line 7
end.

Free Pascal Compiler version 1.9.4 [2004/05/30] for i386
Copyright (c) 1993-2004 by Florian Klaempfl
Target OS: Win32 for i386
Compiling test.pas
test.pas(6,6) Error: Identifier not found "ix"
test.pas(7,41) Error: Identifier not found "ix"
Compilation aborted test.pas:7
Runtime error 216 at $00472D7B
  $00472D7B
  $00474F32
  $004C95E0
  $004C96A1
  $0046B074
  $0046A501
  $0046C445
  $0046C456
  $0046C456
  $0046C456

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

P Davidson
Corax Networks Inc.
http://CoraxNetworks.com
___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] reporting bugs? ... fpc 1.9.4 crash

2004-11-20 Thread Jonas Maebe
On 20 nov 2004, at 21:30, David Emerson wrote:
Is there a better place to post bugs, outside the list?
http://www.freepascal.org/bugs/add.php3
Jonas
___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC on ARM (eg Zaurus)

2004-11-20 Thread Den Jean
On Wednesday 10 November 2004 02:45 am, Florian Klaempfl wrote:

> >>Before I can test it, I've to reinstall my Zaurus, when updating to 
> >>3.5.1, the installation got broken :/

I have prepared something to test.

I created a small C-program as a reference (that works)
and then a FPC program that has a problem (it crashes
when compiled for ARM but not when compiled for intel/qvfb)

The program is a minimal Qt program with only one button.
We want to connect a pascal procedure to that button.
The binding is for pascal so it provides hooks to connect pascal TMethods.


// Pascal code that connects a method to the slot clicked()
QButton_clicked_Event(Method):=MyClass.AppQuit;
QButton_hook_hook_clicked(button_hook,Method);


It is this code that does not work under arm,
when the Method is called (the button is clicked), 
the program crashes.

By the way (not related to the problem)
  I did not give the button any text, because
  for this I need to initialize the binding with 
  some external pascal code (see bindhelp),
  and this is not possible in the simple C program.

To show how the Pascal Method gets called in the binding
Here are some extracts of the binding.
The signal clicked() gets connected to a slot of the Qt binding

--
// this is C++ code that implements 
QButton_hook_hook_clicked(button_hook,Method);
// Method is passed as parameter hook and stored in variable clicked_event

void hook_clicked(QHook &hook) { 
  if ( !clicked_event.func )
connect(handle, SIGNAL(clicked()), this, SLOT(clicked_hook()));
  clicked_event = hook;
  if ( !hook.func )
disconnect(handle, SIGNAL(clicked()), this, SLOT(clicked_hook()));
...
...
// clicked_event is defined as this
QHook clicked_event; 
...
...
// QHook is defines as this
typedef struct {
  void *func;
  void *data;
} QHook;
typedef QHook QHookH;
...

In the slot handler it calls the pascal method.
--
   void clicked_hook() {
  if ( clicked_event.func ) {
typedef void (*func_type)(void *data);
(*(func_type)clicked_event.func)(clicked_event.data);
  }private slots:
--


I hope this is enough starting information for this bug of the fpc arm 
crosscompiler.
Ask anything you may feel helpfull to solve this.

The codes is here:
http://users.pandora.be/Jan.Van.hijfte/qtforfpc/test01.tar.gz


By the way (perhaps related), for the intel/qvfb I need to add unit CMem as the 
first unit
of the uses clause to make any FPC Qt program work. 

If I add CMem when compiling  for arm, the program does not want to start. 
it complains with :
-
QSocket::writeBlock: Socket is not open
QSocket::writeBlock: Socket is not open
QSocket::writeBlock: Socket is not open
QSocket::writeBlock: Socket is not open
 No Qt/Embedded server appears to be running. 
 If you want to run this program as a server,
 add the -qws command line option.
-


kind regards,

Den Jean

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal