Skip to content
Snippets Groups Projects
Commit 1f534c2e authored by Florian Weimer's avatar Florian Weimer Committed by Marge Bot
Browse files

Fix C output for modern C initiative

GCC 14 on aarch64 rejects the C code written by GHC with this kind of
error:

   error: assignment to ‘ffi_arg’ {aka ‘long unsigned int’} from ‘HsPtr’ {aka ‘void *’} makes integer from pointer without a cast [-Wint-conversion]
         68 | *(ffi_arg*)resp = cret;
            |                 ^

Add the correct cast.

For more information on this see:
https://fedoraproject.org/wiki/Changes/PortingToModernC



Tested-by: default avatarRichard W.M. Jones <rjones@redhat.com>
parent 08031ada
No related branches found
No related tags found
No related merge requests found
......@@ -560,7 +560,7 @@ mkFExportCBits dflags c_nm maybe_target arg_htys res_hty is_IO_res_ty cc
, ppUnless res_hty_is_unit $
if libffi
then char '*' <> parens (ffi_cResType <> char '*') <>
text "resp = cret;"
text "resp = " <> parens ffi_cResType <> text "cret;"
else text "return cret;"
, rbrace
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment