passing argument 3 of 'print_camera_dtc_log' makes integer from pointer without a cast
时间: 2023-07-16 09:15:20 浏览: 52
这个错误通常是因为您在使用函数时传递了错误类型的参数。函数的第三个参数应该是一个整数,但您传递了一个指针。您需要将指针转换为整数类型,或者检查您传递给函数的参数是否正确。
例如,如果您有以下函数:
```
void print_camera_dtc_log(int camera_id, int dtc_code, int log_level) {
// 打印相机ID、故障码和日志级别
}
```
您可能会像这样调用该函数:
```
int *dtc_code_ptr = get_camera_dtc_code(camera_id);
print_camera_dtc_log(camera_id, dtc_code_ptr, LOG_LEVEL_DEBUG);
```
这里,您传递了一个指向 `int` 类型的指针 `dtc_code_ptr`,而不是 `int` 类型的故障码。要解决这个问题,您可以将指针转换为整数:
```
print_camera_dtc_log(camera_id, (int)dtc_code_ptr, LOG_LEVEL_DEBUG);
```
或者,您可以检查 `get_camera_dtc_code` 函数是否返回了正确的类型。
相关问题
warning: passing argument 1 of 'ERR_PTR' makes integer from pointer without a cast
这是一个技术问题,我可以回答。这个警告是因为 ERR_PTR 函数的第一个参数需要是一个整数类型,但是你传递了一个指针类型的参数。你需要将指针类型的参数转换为整数类型,然后再传递给 ERR_PTR 函数。
passing argument 5 of 'vdma_write_init' makes integer from pointer without a cast如何让解决
这个错误通常表示函数 'vdma_write_init' 的第5个参数传入了一个指针类型的值,但是函数期望的是一个整型值。为了解决这个问题,你需要检查一下你的代码,确认第5个参数的类型是否正确,并且传入的值是否是整型。
如果你确定传入的参数是正确的类型,但是仍然出现这个错误,那么可能是因为你传入的是指针地址,而不是指针指向的值。这种情况下,你需要使用 * 运算符来获取指针指向的值,并将其传递给函数。例如:
```
int value = *pointer; // 获取指针指向的值
vdma_write_init(arg1, arg2, arg3, arg4, value); // 将值传递给函数
```
如果你不确定问题出在哪里,可以将代码贴出来,我们可以一起来看一下。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)