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



Thanks, when I change the declaration from void *(void) to void *() I don't
get that error anymore.

I am not encountering an error saying --

[kernel:annot:missing-spec] src/os/unix/ngx_errno.c:67: Warning:

  Neither code nor specification for function strlen, generating default
assigns from the prototype

[value] src/os/unix/ngx_errno.c:67: builtin Frama_C_strlen: invalid base:
NULL


I had assumed that Frama-C automatically uses its own specfication for libc
functions such as strlen, so why do I get that complaint?

Thanks,
Divya

On Wed, Jul 4, 2018 at 7:55 AM, Virgile Prevosto <virgile.prevosto at m4x.org>
wrote:

> 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
>
> _______________________________________________
> Frama-c-discuss mailing list
> Frama-c-discuss at lists.gforge.inria.fr
> https://lists.gforge.inria.fr/mailman/listinfo/frama-c-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/frama-c-discuss/attachments/20180704/a1b849f1/attachment.html>