- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 Frama-c 的新手,在尝试打开 C 源文件时遇到了问题。
The error shows as
"fatal error: event.h: No such file or directory. Compilation terminated".
[kernel] Parsing FRAMAC_SHARE/libc/__fc_builtin_for_normalization.i (no preprocessing)
[kernel] Parsing WorkSpace/bipbuffer.c (with preprocessing)
[kernel] user error: failed to run: gcc -E -C -I. -dD -D__FRAMAC__ -nostdinc -D__FC_MACHDEP_X86_32 -I/usr/share/frama-c/libc -o '/tmp/bipbuffer.ce6d077.i' '/home/xxx/WorkSpace/bipbuffer.c' you may set the CPP environment variable to select the proper preprocessor command or use the option "-cpp-command".
[kernel] user error: stopping on file "/home/xxx/WorkSpace/bipbuffer.c" that has errors. Add'-kernel-msg-key pp' for preprocessing command.
所以基本上我试图打开一个 C 源文件,但它返回这样的错误。我还尝试了其他非常简单的 C 文件,如 hello world 和其他切片函数,效果很好。
我以为是因为我没有 'event.h' 的依赖,但在我安装了 libevent 依赖后它仍然返回这些错误。我不确定是否需要为 frama-c 手动设置一些依赖路径
这是我要打开的 C 文件的一部分(来源链接:https://memcached.org/):
#include "stdio.h"
#include <stdlib.h>
/* for memcpy */
#include <string.h>
#include "bipbuffer.h"
static size_t bipbuf_sizeof(const unsigned int size)
{
return sizeof(bipbuf_t) + size;
}
int bipbuf_unused(const bipbuf_t* me)
{
if (1 == me->b_inuse)
/* distance between region B and region A */
return me->a_start - me->b_end;
else
return me->size - me->a_end;
}
......
谢谢,
最佳答案
使用 C 源代码的编译器和其他工具需要知道在哪里可以找到头文件。它们会自动查找一些标准位置,但 Frama-C 的位置比普通编译器少(并且不同)。
你需要找出event.h
的安装位置,然后传递类似-cpp-extra-args "-I/path/to/directory/"
到 Frama-C。仅传递目录名称,不包括名称 event.h
本身。
关于Frama-C 中止无效的用户输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50009929/
当我使用 frama-c 分析我的 c 程序时。 frame-c 的影响插件中似乎存在一个错误。这是我的程序。 #include int global; int main() { global
抱歉,如果这在某处有详细说明,我尝试在 Frama-C 的不同文档中进行搜索,但没有走运。 我正在尝试在我的代码中进行死代码消除,但我不明白该工具的结果。是否有任何文件/文档可以解释此插件的工作原理?
我是 Frama-c 的新手,我想了解这个简单示例有什么问题: /*@ requires \valid(array+(0..length-1)) @ ensures \forall integer k
我有一个 16 位 MPU,它与 x86_16 的大小不同 size_t , ptrdiff_t等。谁能给我详细说明和明确说明如何在 Frama-C 中为我的 MPU 自定义机器依赖项? 最佳答案 目
我正在尝试使用 frama-c 验证以下代码段 /*@ ensures \result != \null; @ assigns \nothing; @*/ extern int *new_va
在 EVA tutorial ,我找到了这个截图:并解释:“导致此问题的确切值显示在列 c5 中:-1。C 标准将负数的左移视为未定义行为。因为 -1 是此调用堆栈中唯一可能的值,因此减少由警报引起的
我想分析一个大型项目的文件以使用 Frama-C 创建程序依赖图,但不断出现奇怪的错误,例如: /usr/include/bits/fcntl-linux.h:305:[kernel] user er
有人可以告诉我这是 Frama-C 中整数和无符号整数的非确定性值的正确模型吗? /* Suppose Frama-C is installed in /usr/local -default pref
使用某些基准运行 Frama-C 值分析时,例如susan 在 http://www.eecs.umich.edu/mibench/automotive.tar.gz 中,我们注意到很多 block
我想证明 Frama-C 中欧几里德除法的循环实现: /*@ requires a >= 0 && 0 =0; loop assigns q,r; loop variant r;
我正在尝试学习 ACSL,但在尝试编写完整的规范时遇到了困难。我的代码 #include #include #define NUM_ELEMS (8) /*@ requires expected
我尝试在 Windows 7 上运行 Frama-C,但没有成功。 我已阅读您在这里写的所有提示和评论,但仍然不起作用。 有人可以用一种清晰简单的方式解释安装过程吗,我将不胜感激? 最佳答案 Wind
我正在尝试在函数中插入断言。这是我所做的: void foo(int a) { //@ assert a == 1; } void main() { foo(1); foo(2);
我刚刚开始开发一个 frama-c 插件,该插件正在执行某种别名分析。我正在使用 Dataflow.Backwards 分析,现在我必须遍历不同的赋值语句并收集一些有关左值的内容。 frama-c 是
这感觉像是一个愚蠢的问题,但我被难住了。我正在尝试使用 Frama-C Sodium 和 Why3 0.86.1(均通过 OPAM 安装)来证明一些简单的属性。考虑这个程序 (toy.c): int
我正在尝试验证来自 Frama-C + WP 的简单程序。 #include /*@ requires valid_read_string(s); assigns \
尝试使用推荐的 opam 方法安装 Frama-C 会出现以下错误: ### stdout ### # Cleaning Installation directory # Installing
我找到的最接近的答案可能与 Eva 插件的 -absolute-valid-range 有关,但真的是这样吗?我是否必须想出读/写 ACSL 谓词来执行虚拟读/写? 示例代码: #include #
我想对多个 文件执行代码转换,并将这些转换产生的更改写回原文件,最好是原始文件。例如,我想向源自文件 fileA.c 的函数 funcA 和函数 funcB 添加一个 if 语句在文件 fileB.c
我应该如何证明如下代码的正确性,为了避免效率低下,它依赖于模运算? #include uint32_t my_add(uint32_t a, uint32_t b) { uint32_t r
我是一名优秀的程序员,十分优秀!