Skip to content

CApiFFI: add ConstPtr for encoding const-qualified pointer return types (#22043)

Alex D requested to merge wip/T22043 into master

Previously, when using capi calling convention in foreign declarations, code generator failed to handle const-cualified pointer return types. This resulted in CC toolchain throwing -Wincompatible-pointer-types-discards-qualifiers warning.

Foreign.C.Types.ConstPtr newtype was introduced to handle these cases - special treatment was put in place to generate appropritetly qualified C wrapper that no longer triggers the above mentioned warning.

Fixes #22043 (closed)

Merge request reports