Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2009-07

missing descriptions for few compiler magic functions

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Paul Ishenin

Hello, FPC developers' list

I have found that next functions are not described here: http://freepascal.org/docs-html/rtl/system/index.html

The functions are:
- BitSizeOf
- Finalize
- get_frame
- Initialize
- Pack
- ReadStr
- Unaligned
- Unpack
- WriteStr

It is difficult to find any documentation for them since they are not present in delphi too (except initialize, finalize).

If I am looking at the wrong place please point me to the right one.

Best regards,
Paul Ishenin.

Reply by email

Jonas Maebe
to Paul Ishenin
Paul Ishenin wrote
I have found that next functions are not described here: http://freepascal.org/docs-html/rtl/system/index.html

Several of them are 2.3.1, so it's normal that they are not yet in the documentation.

The functions are: - BitSizeOf

It's similar to sizeof, except that it returns the size in bits of the type when it is used in a bitpacked record or array.

- get_frame

It returns a pointer to the current routine's stack frame, and at the same time makes sure that the compiler does not optimize the stack frame of the current routine away.

- Pack - ReadStr - Unpack - WriteStr

These come straight from ISO (Standard or Extended) Pascal and behave exactly as described in the standards:
* Pack, Unpack: http://www.moorecad.com/standardpascal/iso7185.html#6.6.5.4%20Transfer%20procedures
* ReadStr, WriteStr: section 6.7.5.5 of http://www.moorecad.com/standardpascal/iso10206.pdf (p. 86 of the pdf)

- Unaligned

Make the compiler assume that the argument is an unaligned memory location (it takes a "var" parameter, i.e., not a pointer but what the pointer points to), and hence that the compiler should use load instructions that are safe in such a situation on CPUs that require this (such as ARM and SPARC).

Jonas

Reply by email

Michael Van Canneyt
to Paul Ishenin: Hello, FPC developers' list I have found that next functions are not described here:…
Paul Ishenin wrote 20 lines
Hello, FPC developers' list I have found that next functions are not described here: http://freepascal.org/docs-html/rtl/system/index.html The functions are: - BitSizeOf - Finalize - get_frame - Initialize - Pack - ReadStr - Unaligned - Unpack - WriteStr It is difficult to find any documentation for them since they are not present in delphi too (except initialize, finalize). If I am looking at the wrong place please point me to the right one.

I will not start bringing the RTL unit reference up to date till we decide on a release schedule for 2.4.0, just like for all other releases. (one usually works better under pressure ;))

Michael.

Reply by email

Paul Ishenin
to Jonas Maebe: Several of them are 2.3.1, so it's normal that they are not yet in the documentation.…
Jonas Maebe wrote
Several of them are 2.3.1, so it's normal that they are not yet in the documentation.

Ah. Then it is ok.

Show quoted text 12 lines
> - Pack > - ReadStr > - Unpack > - WriteStr These come straight from ISO (Standard or Extended) Pascal and behave exactly as described in the standards: * Pack, Unpack: http://www.moorecad.com/standardpascal/iso7185.html#6.6.5.4%20Transfer%20procedures * ReadStr, WriteStr: section 6.7.5.5 of http://www.moorecad.com/standardpascal/iso10206.pdf (p. 86 of the pdf)

Thanks, now Pack and Unpack are more clear for me.

For Lazarus we need their correct definitions to list them the the identifier completion window. We aready declared them somehow but I searched for better declarations of your team.

Best regards,
Paul Ishenin.

Reply by email