- 论坛徽章:
- 1
|
- #include "stdio.h"
- #include <time.h>
- #include <sys/time.h>
- #include <math.h>
- #include <string.h>
- #include <sys/ioctl.h>
- #include <unistd.h>
- #include <fcntl.h>
- #include "errno.h"
- #include <pthread.h>
- #include <stdint.h>
- #include <signal.h>
- #include<sys/time.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <dirent.h>
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <sys/syscall.h>
- #include <sys/select.h>
- #include <ctype.h>
- #include <limits.h>
- typedef enum {
- QMI_RESULT_TYPE_MIN_ENUM_VAL_V01 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/
- QMI_RESULT_SUCCESS_V01 = 0,
- QMI_RESULT_FAILURE_V01 = 1,
- QMI_RESULT_TYPE_MAX_ENUM_VAL_V01 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/
- }qmi_result_type_v01;
- typedef struct {
- qmi_result_type_v01 result;
- /**< Result code
- - QMI_RESULT_SUCCESS
- - QMI_RESULT_FAILURE
- */
- }qmi_response_type_v01; /* Type */
- typedef struct {
- /* Mandatory */
- /* Result Code */
- /**< Standard response type. */
- /* int ab; */ //但如果我加上这个int ab后,再用g++ test.c,是可以编译过的。
- qmi_response_type_v01 resp;
- /**< \n
- (Extended sizes to accommodate LTE.)
- */
- }nas_get_rf_band_info_resp_msg_v01; /* Message */
- int main(int argc, char **argv)
- {
- int s;
- int ret;
- nas_get_rf_band_info_resp_msg_v01 getBandResp = {0};
- while (1);
-
- return 0;
- }
复制代码 上面是我提取出来的代码。鉴于项目的原因,我们不能修改makefile,也最好不要先分配getBandResp后再用memset,请问大侠有什么解决办法呢?
谢谢!
如果用gcc编译,是可以的,但g++编译就出错:
test111.c: In function 鈥榠nt main(int, char**)鈥
test111.c:333:55: error: invalid conversion from 鈥榠nt鈥to 鈥榪mi_result_type_v01鈥[-fpermissive]
nas_get_rf_band_info_resp_msg_v01 getBandResp = {0}; |
|