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 can I get line number from Cil_types.location

  • Subject: [Frama-c-discuss] How can I get line number from Cil_types.location
  • From: diarr_rokiatou at (Rokiatou DIARRA)
  • Date: Sun, 11 Mar 2018 20:39:32 +0000 (UTC)
  • References: <>

I want to get only line number in source file. With Printer.pp_location I get the full path to the source like <dir/f>:<l>. But I want just the line number.
I looked in Frama-c sources, and I found in Cil_datatype.Location module a printer : val pretty_line: t Pretty_utils.formatter . 
So I tried it with the following instructions:
    let line =( Cil_datatype.Location.pretty_line loc); (where loc has type Cil_types.location = Lexing.position * Lexing.position) but I got this error message:

Error: This expression has type
         Cil_types.location = Lexing.position * Lexing.position
       but an expression was expected of type Lexing.position

Are there any functions, in Frama-C, to get only the line number?
Rokiatou DIARRAE-Mail: diarr_rokiatou at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>