Frama-C-discuss mailing list archives

This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] Casting to a generic function pointer



Hello,


2018-07-03 13:48 GMT+02:00 Divya Muthukumaran <divya84 at gmail.com>:

>
> I am trying to analyse nginx source code with Frama-C, and I want to run
> Impact analysis on the preprocessed files. I ran into an issue where a
> function declaration accepts a generic void (*) (void)
> function pointer but the call to that function passes it something with a
> different signature. Frama-c gives me this complaint.
>
> [kernel] src/event/ngx_event_openssl_stapling.c:185: Failure:
>
>   conversion between function types with different number of arguments:
>
>   int (*)(SSL *ssl_conn, void *data)
>
>   and
>
>   void (*)(void)
>
> Any ideas how how I can get past this?
>
>
Indeed, Frama-C is now a bit restrictive on function pointer casts. Namely,
if  both types provide a parameter type list, their length must be equal
(so that analyzers can assume that at call site the actual function has the
appropriate number of arguments). However, it is still possible to cast any
function pointer to a function pointer that does not specify such a list,
i.e. void(*)(). Note that you'll still get a warning about incompatible
return types, but this is only a  warning and can be silenced with
-kernel-warn-key="-typing:incompatible-types-call" option.

Best regards,
-- 
E tutto per oggi, a la prossima volta
Virgile
-------------- section suivante --------------
Une pièce jointe HTML a été nettoyée...
URL: <http://lists.gforge.inria.fr/pipermail/frama-c-discuss/attachments/20180704/10d57262/attachment.html>