Skip to content

fpc ctypes.cbool incompatible with gcc _Bool

System Information

Steps to reproduce

  1. create file myclib.c:
    #include <stdio.h>
    void mycfunc(_Bool arg){
    	printf("number: %d\n",arg?1:2);
    }
  2. gcc -O1 -shared -o libmyclib.so myclib.c
  3. create file prog.pas:
    {$LINKLIB myclib}
    uses ctypes;
    procedure mycfunc(arg:ctypes.cbool);cdecl;external;
    begin
    	mycfunc(false);
    	mycfunc(true);
    end.
  4. ppcx64 prog
  5. LD_LIBRARY_PATH=. ./prog

What is the current bug behavior?

number: 2
number: -253

What is the expected (correct) behavior?

number: 2
number: 1
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information