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
- Subject: [Frama-c-discuss] Casting to a generic function pointer
- From: virgile.prevosto at m4x.org (Virgile Prevosto)
- Date: Wed, 4 Jul 2018 08:55:53 +0200
- In-reply-to: <CAGgQLD66u7J49bYd96otyjGpoWqUr7PkQu73RWtc6KX_5u6SoA@mail.gmail.com>
- References: <CAGgQLD66u7J49bYd96otyjGpoWqUr7PkQu73RWtc6KX_5u6SoA@mail.gmail.com>
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>
- Follow-Ups:
- [Frama-c-discuss] Casting to a generic function pointer
- From: divya84 at gmail.com (Divya Muthukumaran)
- [Frama-c-discuss] Casting to a generic function pointer
- References:
- [Frama-c-discuss] Casting to a generic function pointer
- From: divya84 at gmail.com (Divya Muthukumaran)
- [Frama-c-discuss] Casting to a generic function pointer
- Prev by Date: [Frama-c-discuss] Casting to a generic function pointer
- Next by Date: [Frama-c-discuss] Casting to a generic function pointer
- Previous by thread: [Frama-c-discuss] Casting to a generic function pointer
- Next by thread: [Frama-c-discuss] Casting to a generic function pointer
- Index(es):