Error with "\226\128\147" when running Frama-C command - frama-c

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.

"\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.

Related

R error: '\U' used without hex digits in character string starting "'C:\U"

Upon start up, when I run Rstudio I get the following error message:
"Error: '\U' used without hex digits in character string starting "'C:\U"
This is not an issue when trying to run scripts within Rstudio. However, this error prevents me from running any R script as a local job or outside of RStudio.
I unistalled and reinstalled R 4.0.0 and I am still seeing the same error. When I restart R this is how it appears in the console..
Restarting R session...
Error: '\U' used without hex digits in character string starting "'C:\U"
I do not have any paths in my Rscript or Rprofile. I tried setting my working directory in my Rprofile and it did not remove the error. Any ideas?
I had the same issue and after I deleted .Rprofile and .radian_history from my user directory, the error message disappeared.

Error: "Decoding error (36) : Dictionary mismatch" using ZSTD decode on command line to decode a .ZST file

I am trying to decode a bunch of .ZST files which I do not know what the original file was so I can access them, however all of the .ZSTs return the exact same error and do not get decompressed. The error is Decoding error (36) : Dictionary mismatch. The command used is zstd -d * on Windows 10 x64 using ZSTD v1.4.4 for Win x64.
I have already tried CMD, PowerShell and Bash as different environments to run the command but all return the exact same error. I have tried decompressing a single individual file to see if it was a bulk-operation issue but it didn't work either. My last attempt was to Google for the error but I could not find anything.
Edit: After investigating a little further, I decided to try checking for the MIME types of my ZST files, some of them get returned as application/x-zstd while others get returned as application/octet-stream. I wonder if this could be the issue? Although neither MIME types work, both return the same error.
Does anyone know how I could fix this error and get to decompress my files?
Here is one of the ZST files for reference: https://mega.nz/#!eV0VTKBQ!WBW_pVIq8Tsn2Rrv3XKmt4DSAH7IHbHtaAuNB9uRTMQ

Frama-c fails to parse an ACSL manual example list_length involving a pattern matching construct

On the following function definition (list.c):
//# type list<A> = Nil | Cons(A,list<A>);
/*# logic integer list_length<A>(list<A> l) =
# \match l {
# case Nil : 0
# case Cons(h,t) : 1 + list_length(tail)
# };
*/
frama-c fails with the message:
$ frama-c -wp -wp-rte list.c
[jessie3] Loading Why3 configuration...
[jessie3] Why3 environment loaded.
[jessie3] Loading Why3 theories...
[jessie3] Loading Why3 modules...
[kernel] Parsing FRAMAC_SHARE/libc/__fc_builtin_for_normalization.i (no preprocessing)
[kernel] Parsing list.c (with preprocessing)
list.c:4:[kernel] user error: unexpected token 'l'
[kernel] user error: stopping on file "list.c" that has errors. Add '-kernel-msg-key pp'
for preprocessing command.
[kernel] Frama-C aborted: invalid user input.
The example is taken directly from the ACSL manual.
Why does it have troubles associating l with the only parameter of the function?
P.S. I use frama-c version: Sodium-20150201
Pattern matching is not supported in the current implementation of Frama-C. In order to check whether a specific ACSL feature is supported by the kernel (which does not always mean that your favorite plug-in will handle it), refer to the ACSL implementation manual. As mentioned in the intro of the manual, every entry appearing in red is unsupported by the current version of Frama-C.

frama-c mingw __restrict__ keyword

I am new to Frama-C. I would like to run it under Windows enviroments. My compiler is gcc,mingw.
I have tryied to run same examples from Value Analysis tutorial by I have a problem with library header files.
I've found that it's not possible to run frama-c because restrict keyword. It shows error in string.h file
void * __cdecl memcpy(void * __restrict__ _Dst,const void * __restrict__ _Src,size_t _Size) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
When I manually add #define restrict to all *.c files in SkeinProject
schneier.com/code/skein_NIST_CD_102610.zip
everything works correcly. By doing it by hand is not what I'm looking for.
Next step was to add argument -D__restrict__
frama-c -cpp-extra-args=-D__restrict__ -main=Init -val SHA3api_ref.c
[kernel] preprocessing with "gcc -C -E -I. -D__restrict__ SHA3api_ref.c"
../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/string.h:41:[kernel] user error: syntax error
[kernel] user error: skipping file "SHA3api_ref.c" that has errors.
[kernel] Frama-C aborted because of an invalid user input.
I've also generated precompiled *.i files but error still the same.
gcc -E -D__restrict__ SHA3api_ref.c >SHA3api_ref.i
frama-c -main=Init -val SHA3api_ref.i
../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/string.h:41:[kernel] user error: syntax error
[kernel] user error: skipping file "SHA3api_ref.i" that has errors.
[kernel] Frama-C aborted because of an invalid user input.
What can I do with it?
Your system headers contain non-standard syntax extensions that are not supported by Frama-C. This is normal, as the headers are often provided as part of a complete package with the compiler, so the headers and the compiler only need to work together, not to work with all the other programs that take C source code as input.
Generally speaking, you should always use the headers provided with Frama-C
instead of those from your system.
When using GCC or a compatible compiler such as Clang, this involves
passing the pre-processor the options -nostdinc and -I... where ...
stands for the place where Frama-C's headers were installed. This
location can be obtained from Frama-C with the option -print-share-path.
All in all, on a Unix system, it may look like:
frama-c -cpp-extra-args=-nostdinc -cpp-extra-args=-I`frama-c -print-share-path`/libc .....
Doing the same thing with Windows and MinGW follows the same idea but sometimes involves extra trouble due to the perpetual ambiguity between \ and / as directory separators.
Recently, Frank Dordowsky has been having trouble with using a very new GCC version to pre-process C files for Frama-C. That was only when using -pp-annot, but in any case, the solution was to switch to Clang as pre-processor.

Compiling QVision

I'm trying to compile QVision under Windows as instructed here: http://qvision.sourceforge.net/DownloadAndSetup.html
When I do that, I get the following in Qt Creator:
c:\Users\Medicine - SWEng\Desktop\qvision.0.6.0\common.pri:37:
warning: Unable to find file for
inclusion config.pri
And,
:-1: error: File config.pri not present. Read the INSTALL file, and modify config.pri.example to generate it.
UPDATE:
After solving the preceding error by renaming config.pri.example to config.pri, I now get the following warning:
c:\Users\Medicine - SWEng\Desktop\qvision.0.6.0\config.pri:43: warning: Unescaped backslashes are deprecated.
This error still remains even though I changed the path to where QVision is saved as follows: INSTALL_PATH=C:\Users\Medicine - SWEng\Desktop\qvision.0.6.0
I'm also getting this warning:
c:\Users\Medicine - SWEng\Desktop\qvision.0.6.0\src\qvgsl.pri:31: warning: Unescaped backslashes are deprecated.
The error I'm getting is:
:-1: error: In module qvmplayer: QVMPlayer binary was not found at: /usr/bin/mplayer . Set a correct path in the MPLAYER_BINARY_PATH variable at the config.pri file
Any ideas on that?
Thanks.
Read the install documentation you pointed to:
You must rename the file config.pri.example to config.pri. This file contains several parameters and options that configure the compilation and functionallity of the QVision.
... Open the file config.pri with a text editor, and read carefully the instructions contained in that file about how to tune each configuration parameter.
Warnings for "Unescaped backslashes are deprecated" are due to the content in variables INSTALL_PATH and GSL_PATH, in the 'config.pri' file. Read for example:
http://www.qtforum.org/article/33409/unescaped-backslashes-are-deprecated.html

Resources