Recent

Author Topic: external SIGSEGV error when calling function as procedure  (Read 1038 times)

kegge13

  • New Member
  • *
  • Posts: 45
    • the BistroMath project
external SIGSEGV error when calling function as procedure
« on: March 31, 2020, 10:58:01 pm »
Code: Pascal  [Select][+][-]
  1. function someobject.dosomething(abool:boolean): boolean;
  2. begin
  3. result:= true;
  4. end;
  5.  
  6. .....
  7.  
  8. var myobject: someobject.
  9. ....
  10. myobject.dosomthing(false);
  11.  
  12.  

In my port of a large Delphi 7 project I get an external SIGSEGV error when I make a call to a object function as were it a procedure, i.e. ignoring the function result. Is there a compiler option to make this acceptable?

thanks in advance

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: external SIGSEGV error when calling function as procedure
« Reply #1 on: March 31, 2020, 11:42:31 pm »
No compiler option exists or is needed AFAIK.
Your SIGSEGV must arise elsewhere.
Are you sure myobject is not Nil?

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: external SIGSEGV error when calling function as procedure
« Reply #2 on: April 01, 2020, 09:17:19 am »
There is a compiler directive to allow that "extended syntax": [$X+} or {$EXTENDEDSYNTAX ON}, as well as command line option -Sa1 but, first, that feature is ON by default and second, even if it were off for some reason it would not give a SISSEGV but fail to compile.

There must be some other error in your code, as Howard said.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5486
  • Compiler Developer
Re: external SIGSEGV error when calling function as procedure
« Reply #3 on: April 01, 2020, 09:50:34 am »
In my port of a large Delphi 7 project I get an external SIGSEGV error when I make a call to a object function as were it a procedure, i.e. ignoring the function result. Is there a compiler option to make this acceptable?

As the others said, you have a different error (likely your instance is Nil). If extended syntax would be switched of then you'd get a compile time error.

Please provide a full example that demonstrates your problem.

kegge13

  • New Member
  • *
  • Posts: 45
    • the BistroMath project
Re: external SIGSEGV error when calling function as procedure
« Reply #4 on: May 19, 2020, 05:09:05 pm »
Indeed the problem arised not through this construct, it took a while find the real problem although.
Thanks for your responses.

 

TinyPortal © 2005-2018