Recent

Author Topic: [Solved] Is it possible to const an argument passed by reference in FPC?  (Read 13387 times)

440bx

  • Hero Member
  • *****
  • Posts: 2765
Re: Is it possible to const an argument passed by reference in FPC?
« Reply #60 on: August 03, 2019, 10:53:13 am »
*rolls eyes*
Is that another "very useful" parameter passing convention supported by FPC too ?
FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 64bit.

munair

  • Hero Member
  • *****
  • Posts: 791
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: Is it possible to const an argument passed by reference in FPC?
« Reply #61 on: November 27, 2021, 08:49:45 pm »
Then discussion went into untyped... I got lost... :o
I suggest _never_ using untyped parameters. 

An untyped parameter implicitly causes the caller to pass any data type by reference since the parameter has no type.  It's one of those "great ideas" from a compiler writer who inhaled too much leaded red paint fumes before reaching the keyboard.
:D
This thread was very helpful and inspirational at the same time.
keep it simple

 

TinyPortal © 2005-2018