[fpc-devel] Freepascal in microcontrollers

Vinzent Hoefler JeLlyFish.software at gmx.net
Wed Feb 27 13:42:52 CET 2008


On Wednesday 27 February 2008 12:56, Jonas Maebe wrote:

> On 27 Feb 2008, at 12:17, Vinzent Hoefler wrote:
>
> > Free Pascal Compiler version 2.0.0 [2005/09/09] for i386
> > Copyright (c) 1993-2005 by Florian Klaempfl
> > Target OS: Linux for i386
> > Compiling test.pas
> > test.pas(6,10) Error: Identifier not found "bitpacked"
>
> "bitpacked" was introduced in version 2.2.0 (which is the latest
> official release).

See, and that's a problem im production code. The project started at the 
time where 1.0.10 was current (and a couple of months later I used the 
1.9.6 release candidate), but due to several show-stoppers (thread 
leaks, random XML parser crashes) I'm currently stuck to version 2.0.0.

Of course, I tried version 2.2.0 shortly after its release, but then the 
project didn't even compile anymore. Ok, my fixed up version of the 
tread manager implementation was expected to break, but that suddenly 
subroutines were moved to other units wasn't something I expected. 
(Yes, the Interlocked stuff is now in System where before it was in 
SysUtils - which generally is a good thing; when using such code, 
chances are high, you don't even want to pull in SysUtils - , but still 
it breaks my code). And there may have been other issues, I don't 
remember.

Of course, some day soon I'll probably do a branch to migrate to 2.2.0, 
but until then, sorry, "bitpacked" or not, documented or not, I can't 
use it, because it doesn't exist in the current setup.

> That said, bitpacking is unsuited for hardware interfacing because it
> is opaque:

And that's why I'd rather go with Ada's representation clauses. If the 
hardware platform is unsuitable for the thing I want it to do, it 
simply doesn't compile. Which is justified, because in 99% of the times 
such RCs are hardware specific.

> The bit layout is also different on little and big endian systems.

And let me guess: There's no way to specify how the Endianess of the 
bitpacked type should be interpreted regardless of the target system?


Vinzent.



More information about the fpc-devel mailing list