c - vxWorks 警告 : variable <task> is used before its value is set

标签 c eclipse vxworks

这是我的问题警告(etoa:4549):变量“T1”在设置值之前被使用

enter image description here

当我运行它时,调试器打开!

enter image description here

我不知道出了什么问题,我无法运行它!

CPU: Windows 6.1. Processor #0. Memory Size: 0x1f00000 (31Mb). BSP version 6.9/0. Created: Jul 17 2012, 10:12:44 ED&R Policy Mode: Deployed WDB Comm Type: WDB_COMM_PIPE WDB: Ready.

-> Exception !
Vector 13 : Access Violation
Program Counter:        0x00000000
Access Address (read):  0x00000000
Status Register:        0x00010246
Task: 0x1044e2d0 "T3"
0x1044e2d0 (T3): task 0x1044e2d0 has had a failure and has been stopped.
0x1044e2d0 (T3): fatal kernel task-level exception!
Exception !
Vector 13 : Access Violation
Program Counter:        0x00000000
Access Address (read):  0x00000000
Status Register:        0x00010246
Task: 0x1044dce0 "T1"
0x1044dce0 (T1): task 0x1044dce0 has had a failure and has been stopped.
0x1044dce0 (T1): fatal kernel task-level exception!
Exception !
Vector 13 : Access Violation
Program Counter:        0x00000000
Access Address (read):  0x00000000
Status Register:        0x00010246
Task: 0x1044dfd8 "T2"
0x1044dfd8 (T2): task 0x1044dfd8 has had a failure and has been stopped.
0x1044dfd8 (T2): fatal kernel task-level exception!

最佳答案

您有一个变量 int task_1 以及一个同名函数 void task_1(void)。因此,当您打算将函数指针作为参数传递给 taskSpawn 时,您实际上传递的是 int 变量 task_1。这会导致在分配 task_1 之前发出警告。

您应该更改其中一个的名称,以免发生冲突。

int task_id_1, task_id_2, task_id_3, msgQueueId;

task_id_1 = taskSpawn(..., (FUNCPTR)task_1, ...);

关于c - vxWorks 警告 : variable <task> is used before its value is set,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34362625/

相关文章:

c++ - 符号的数据大小

c - 全局变量如何影响可执行文件的大小?

c - fork() 是否为子进程创建了父进程创建的所有变量和对象的重复实例?

c - 如何正确重置缓冲区以便下一次读取正确?

eclipse - 字段的 IntelliJ 调用层次结构

exception - 如何确定任务销毁的原因,VxWorks?

c - 为什么使用 char** 会导致 char* 工作时出现段错误?

无法正确打印txt文件

java - 将 GAE 项目迁移到 Java 8 - 将运行时属性添加到 appengine-web.xml 后出现 XML 验证错误

java - 发言失败:not bound to tts engine