-1

I am getting this error when I try to run a C program using Frama-C. How to fix this error?

$ frama-c –wp 2.c
[kernel] Parsing FRAMAC_SHARE/libc/_fc_builtin_for_normalisation.i (no preprocessing)
[kernel] user error: source file "\226\128\147wp" does not exist
[kernel] user error: stopping on file "\226\128\147wp" that has errors. 
[kernel] Frama-C aborted: invalid user input. 

Note: the original question included a screenshot of the terminal, where the difference between the two hyphens was barely visible.

anol
  • 8,264
  • 3
  • 34
  • 78
  • 1
    [Please do not upload images of code/errors when asking a question.](//meta.stackoverflow.com/q/285551) – anol Sep 10 '20 at 08:59
  • 1
    please, don't link to a screen shot, but put in the question the commands you've made and the output you got, as text (use backticks to have them formatted as code, as mentioned in the help). Also, which version of Frama-C are you using, on which OS, and how did you install it? Finally, this might look like an encoding error in the way Frama-C interprets the path to its resource files. What is your locale (use `locale` command on your terminal)? – Virgile Sep 10 '20 at 09:01
  • 1
    I'd guess you copy/pasted the line from a PDF or somewhere, and the hyphen character is not the "standard" ASCII one, but a non-ASCII Unicode character that looks like it. Try erasing it and writing a simple `-` with the keyboard, and see if it helps. – anol Sep 10 '20 at 09:09
  • 1
    (and indeed, "\226 \128 \147" is the UTF-8 representation of the Unicode character EN DASH; replace it with a proper ASCII hyphen and the command line should work) – anol Sep 10 '20 at 09:40
  • Thanks @anol. Yeah, what u said is right. I am new to frama-c and so I copied the command and it landed me in this error. Thanks once again!! – garine srija Sep 10 '20 at 16:11
  • I fixed the image for you and added a proper answer, so that future users might benefit from it. Please consider accepting it if it solves your problem. Also, consider mentioning where you copied the "-wp" from; if it's from one of Frama-C's manuals, the authors might want to change the encoding to avoid it in the future. – anol Sep 11 '20 at 05:47

1 Answers1

2

"\226\128\147" is the UTF-8 sequence for the Unicode EN DASH character, which looks visually almost identical to an ASCII hyphen.

When Frama-C parses the command-line, it searches for an ASCII hyphen exclusively, and since it does not find one, it assumes the sequence that looks like -wp is a file name, which does not exist, hence the error message.

This error commonly happens when copying/pasting code from PDFs. Erasing the character and replacing it with a proper hyphen allows Frama-C to work as intended.

anol
  • 8,264
  • 3
  • 34
  • 78