[fpc-pascal] Documentation confusion or error

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Wed May 8 13:10:42 CEST 2019


Hi,

https://www.freepascal.org/docs-html/rtl/sysutils/longrec.html

I'm referring to the documentation shown in the URL above. As far as I
know the fpdoc is sensitive to which platform it is running on (unless
explicitly told otherwise), and will generate documentation according to
that platform. Please correct me if I am wrong, but this was my personal
experience with fpdoc.

Anyway, as far as I know the FPC documentation is normally generated on
a Linux system with 64-bit Intel type CPU.

If so, that means the documentation shown above has the Hi, Lo fields in
the wrong order. Showing Big Endian instead of Little Endian (what Intel
desktop CPU's are).


Based on the real source code found in sysutilh.inc, this is how the
record is actually defined:


   LongRec = packed record
      case Integer of
{$ifdef FPC_LITTLE_ENDIAN}
        0 : (Lo,Hi : Word);
{$else FPC_LITTLE_ENDIAN}
        0 : (Hi,Lo : Word);
{$endif FPC_LITTLE_ENDIAN}
        1 : (Bytes : Array[0..3] of Byte);
   end;

It seems that when generating documentation the FPC_LITTLE_ENDIAN
compiler define is not specified, thus fpdoc defaults to using and
showing the Big Endian source code.


On a side note:
  It might also be a good idea to indicate inside the documentation
  which system was used to generate the docs. Maybe the footer or some
  "About -> Notations" page. As far as I know fpdoc can't show
  documentation for multiple platforms together (like the source code
  shown above).


Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp



More information about the fpc-pascal mailing list