[fpc-pascal] Make a distinct pointer type

Hairy Pixels genericptr at gmail.com
Thu Jun 1 02:47:38 CEST 2023


I'm trying to make an "opaque pointer" type for a c library so the types are just pointers but they should be incompatible. I guess I'll have to make all the records.

> On May 31, 2023, at 9:20 PM, Michael Van Canneyt via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> 
> Type aliases are always assignment compatible.
> 
> As far as I know, there is no way to do what you want with just 'pointer'.
> 
> This will give an error:
> 
> Type
>  RA = record end;
>  RB = record end;
>  PA = ^RA;
>  PB = ^RB;
> 

Regards,
Ryan Joseph



More information about the fpc-pascal mailing list