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] How to get the function list from AST?


  • Subject: [Frama-c-discuss] How to get the function list from AST?
  • From: boris at yakobowski.org (Boris Yakobowski)
  • Date: Tue, 12 Jul 2011 11:35:02 +0200
  • In-reply-to: <4E1C12E0.8070206@inria.fr>
  • References: <CAL2=Xaec=DcV3YwXL2cgKjGZJK+AoTBkLByUk-GYmYsPrkgd4Q@mail.gmail.com> <4E1C12E0.8070206@inria.fr>

On Tue, Jul 12, 2011 at 11:24 AM, Anne Pacalet <anne.pacalet at inria.fr> wrote:
> I think that the functions that are only declared, and not used,
> are not in the AST. You should try either to add a call to the function,
> or to add a body to it.

More precisely, functions that
- are only declared
AND
- do not have an ACSL specification
AND
- are not called or referenced
are completely removed at parsing time.

Functions only declared but that have an ACSL specification are
retained, whether they are called/referenced. However, they do not
appear as a GFun in the list of globals, as this constructor is only
used for defined functions: GFun takes a fundec as argument. Instead,
declared functions appear as GVarDecl. Make sure to check that the
type of the varinfo is a function type, as non-function variables only
declared also appear GVarDecl.

Hope this helps,

-- 
Boris