fpc ctypes.cbool incompatible with gcc _Bool
System Information
- Operating system: KDE neon Unstable Edition
- Processor architecture: x86-64
-
Compiler version:
- 3.3.1 2f9ed057
- 3.3.2 https://sourceforge.net/projects/freepascal/files/Linux/3.2.2/fpc-3.2.2.x86_64-linux.tar/download
- (both same result)
- Device: Computer
Steps to reproduce
- create file
myclib.c
:#include <stdio.h> void mycfunc(_Bool arg){ printf("number: %d\n",arg?1:2); }
gcc -O1 -shared -o libmyclib.so myclib.c
- create file
prog.pas
:{$LINKLIB myclib} uses ctypes; procedure mycfunc(arg:ctypes.cbool);cdecl;external; begin mycfunc(false); mycfunc(true); end.
ppcx64 prog
LD_LIBRARY_PATH=. ./prog
What is the current bug behavior?
number: 2 number: -253
What is the expected (correct) behavior?
number: 2 number: 1